• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revisiona7afa029881c60fc30abaeafd96faf8be48711aa (tree)
Time2022-12-10 14:40:08
Authorphabrics <phabrics@phab...>
Commiterphabrics

Log Message

Miscellaneous changes for better handling system dependencies.

Change Summary

Incremental Difference

--- a/configure.ac
+++ b/configure.ac
@@ -129,6 +129,7 @@ darwin*)
129129 esac
130130
131131 AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
132+AC_CHECK_PROG([CYGPATH_M], [cygpath], [cygpath -m], [echo])
132133
133134 AC_SUBST(DEV_TAP_FILENAME)
134135 AC_SUBST(SETCAP)
@@ -792,7 +793,7 @@ dnl Start the list of display host support.
792793 TME_FB_XLAT_DST="d32b32s0p32olml_r0xffff0000_g0xff00ff00_b0xff0000ff d24b32s0p32olml_r0xff0000_g0xff00_b0xff"
793794
794795 dnl Checks for GLIB.
795-AM_PATH_GLIB_2_0([], [have_glib=$enable_glib], [])
796+AM_PATH_GLIB_2_0([], [AC_DEFINE([HAVE_GLIB], [], [Defined if GLIB 2.0 is found.])], [])
796797
797798 dnl Checks for display type support
798799 AM_PATH_GTK_3_0([], [have_gtk=$enable_gtk], [])
--- a/libopenvpn/openvpn.c
+++ b/libopenvpn/openvpn.c
@@ -309,6 +309,7 @@ openvpn_main (int argc, char *argv[])
309309 return 0; /* NOTREACHED */
310310 }
311311
312+#if 0
312313 #ifdef WIN32
313314 int
314315 wmain (int argc, wchar_t *wargv[]) {
@@ -342,3 +343,4 @@ main (int argc, char *argv[]) {
342343 return openvpn_main(argc, argv);
343344 }
344345 #endif
346+#endif
--- a/libtme/Makefile.am
+++ b/libtme/Makefile.am
@@ -74,3 +74,9 @@ shlibvar.h: $(top_builddir)/config.h Makefile
7474 grep LT_MODULE_PATH_VAR $(top_builddir)/config.h > $@
7575 grep LT_DLSEARCH_PATH $(top_builddir)/config.h >> $@
7676 echo "#define TME_PACKAGE_PATH \"$(libdir)\"" >> $@
77+ echo -n "#define TME_PREFIX_PATH \"" >> $@
78+ echo / | tr -d "\n\r\f" >> $@
79+ echo \" >> $@
80+ echo -n "#define TME_WINDOWS_PATH \"" >> $@
81+ $(CYGPATH_W) / | tr -d "\n\r\f" >> $@
82+ echo \" >> $@
--- a/libtme/module.c
+++ b/libtme/module.c
@@ -97,7 +97,7 @@ _tme_modules_find(const char *top_name,
9797 unsigned int top_name_length,
9898 char **_modules_dir)
9999 {
100- unsigned int modules_dir_length;
100+ unsigned int modules_dir_length, prefix_length = strlen(TME_PREFIX_PATH);
101101 int pass;
102102 const char *search_path;
103103 const char *p1, *p2, *p3;
@@ -147,9 +147,10 @@ _tme_modules_find(const char *top_name,
147147
148148 /* form the modules index pathname to try, remembering what
149149 part of it is the modules directory pathname: */
150- modules_dir_length =
150+ modules_dir_length =
151+ prefix_length
151152 /* the search path part, less any trailing slashes: */
152- (p2 - p1) + 1
153+ + (p2 - p1)
153154 /* a slash: */
154155 + 1
155156 + top_name_length
@@ -162,23 +163,21 @@ _tme_modules_find(const char *top_name,
162163 + strlen("-plugins.txt")
163164 /* a NUL: */
164165 + 1);
165- memcpy(modules_index_pathname, p1, (p2 - p1) + 1);
166- modules_index_pathname[(p2 - p1) + 1] = '/';
167- memcpy(modules_index_pathname
168- + (p2 - p1) + 1
169- + 1,
166+ strcpy(modules_index_pathname, TME_PREFIX_PATH);
167+ strncpy(modules_index_pathname + prefix_length, p1 + 1, (p2 - p1));
168+ prefix_length += (p2 - p1);
169+ modules_index_pathname[prefix_length++] = '/';
170+ strncpy(modules_index_pathname + prefix_length,
170171 top_name,
171172 top_name_length);
172- modules_index_pathname[((p2 - p1) + 1
173- + 1
174- + top_name_length)] = '/';
175- memcpy(modules_index_pathname
176- + modules_dir_length,
173+ prefix_length += top_name_length;
174+ modules_index_pathname[prefix_length++] = '/';
175+ strncpy(modules_index_pathname + prefix_length,
177176 top_name,
178177 top_name_length);
178+ prefix_length += top_name_length;
179179 strcpy(modules_index_pathname
180- + modules_dir_length
181- + top_name_length,
180+ + prefix_length,
182181 "-plugins.txt");
183182
184183 /* try to open the modules index: */
@@ -193,6 +192,7 @@ _tme_modules_find(const char *top_name,
193192
194193 /* keep trying: */
195194 tme_free(modules_index_pathname);
195+ prefix_length = strlen(TME_PREFIX_PATH);
196196 }
197197
198198 /* stop if this was the last path: */
--- a/tme/common.h
+++ b/tme/common.h
@@ -431,11 +431,10 @@ tme_bswap_u128(tme_uint128_t x)
431431 typedef tme_uint64_t tme_time_t;
432432
433433 static _tme_inline tme_time_t tme_thread_get_time _TME_P((void)) {
434-#if defined(WIN32) || defined(USE_GLIB_TIME) && defined(_TME_HAVE_GLIB)
435-#ifdef USE_GLIB_TIME
434+#if defined(USE_GLIB_TIME) && defined(_TME_HAVE_GLIB)
436435 #define TME_FRAC_PER_SEC G_USEC_PER_SEC
437436 return g_get_real_time();
438-#else
437+#elif defined(WIN32)
439438 #define TME_FRAC_PER_SEC 10000000
440439 FILETIME filetime;
441440 ULARGE_INTEGER _time;
@@ -447,7 +446,6 @@ static _tme_inline tme_time_t tme_thread_get_time _TME_P((void)) {
447446 #else
448447 return (_time.u.LowPart) | (_time.u.HighPart << 32);
449448 #endif
450-#endif
451449 #elif defined(USE_GETTIMEOFDAY) || !defined(_TME_HAVE_CLOCK_GETTIME)
452450 #define TME_FRAC_PER_SEC 1000000
453451 struct timeval tv;