Combined cygwin & auto* for mingw patch...



Here is a combination of Stefan Ondrejicka's cygwin patch and changes
to configure and build glib using auto* and libtool for native Win32,
too. Diffs to CVS as of a moment ago. I don't have the possibility to
check how this affects building on Unix right now, could somebody
please check?

For cygwin and mingw, the latest CVS libtool is needed, and even some
patches to that, to make everything go smooth and easy.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/glib/ChangeLog,v
retrieving revision 1.623
diff -u -2 -r1.623 ChangeLog
--- ChangeLog	2001/02/21 12:41:26	1.623
+++ ChangeLog	2001/02/21 15:46:10
@@ -1,6 +1,51 @@
 2001-02-21  Tor Lillqvist  <tml iki fi>
 
-	* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.
+	* gutils.c (g_find_program_in_path): Implement on Win32.
 
+	Cygwin support contributed by Stefan Ondrejicka
+	<ondrej idata sk>. Hopefully I got it all in while simultaneously
+	adding support for auto*/libtool for mingw.
+
+	* Makefile.am: Changes for auto* support on Cygwin and Win32. Do
+	still distribute the hand-written makefiles and *.win32.in files,
+	though. Use GIO, GSPAWN and PLATFORMDEP macros set by configure.
+	Use -no-undefined. Pass -export-symbol glib.def.
+	
+	* configure.in: Define G_PLATFORM_WIN32 on both pure Win32 (mingw)
+	and Cygwin. Add AC_CYGWIN, AC_EXEEXT and AC_LIBTOOL_WIN32_DLL
+	calls for Cygwin and mingw support.  Check for %I64u guint64
+	format (in MS C library). Set G_MODULE_IMPL on mingw and
+	Cygwin. Use ac_object and ac_exeext.  Set GIO, GSPAWN, PLATFORMDEP
+	and G_LIBS_EXTRA. Compile timeloop only on Unix. Define OS_WIN32
+	automake conditional on Win32.
+	
+	* glib.h: Include gwin32.h also on Cygwin.
+
+	* gfileutils.c (get_contents_posix): Use O_BINARY (defined as 0 on
+	Unix) for Cygwin's sake.
+
+	* gtimer.c (GETTIME): Reduce #ifdefs, use a macro GETTIME().
+
+	* gconvert.c
+	* gthread.c
+	* gutf8.c
+	* gutils.c: For code needed both on Cygwin and native Win32,
+	test for G_PLATFORM_WIN32.
+
+	* gtypes.h: Refine GLIB_VAR definition. Also check for DLL_EXPORT
+	in case compiling a static library on Win32 or Cygwin.
+
+	* gwin32.c: No <direct.h> on Cygwin. No need for ftruncate() or
+	dirent emulation on Cygwin.
+	(get_package_directory_from_module) Convert return value from
+	GetModuleFileName() to POSIX path on Cygwin.
+
+	* tests\Makefile.am (progs_LDADD): Link with libglib, libgthread
+	and libgmodule as appropriate. Use -no-undefined.
+
+	* gbacktrace.c: Move #ifdefs around a bit on Win32.
+
+	* gshell.c (unquote_string_inplace): Make static.
+
 	* gthread.h: Include gtypes.h to be sure to get GLIB_VAR
 	definition, remove definition from here.
@@ -14,8 +59,11 @@
 
 	* makefile.mingw.in: Remove install target, Windows isn't Unix.
+	(DEFINES): Add -DDLL_EXPORT.
 
 	* testgdate.c
 	* testgdateparser.c
 	* testglib.c: Undefine GLIB_COMPILATION.
+
+	* testglib.c: Make some vars static. Add Cygwin path tests.
 
 	* glib.def: Updates.
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/Makefile.am,v
retrieving revision 1.76
diff -u -2 -r1.76 Makefile.am
--- Makefile.am	2001/02/21 12:41:26	1.76
+++ Makefile.am	2001/02/21 15:46:11
@@ -19,9 +19,5 @@
 	makefile.msc.in		\
 	makefile.mingw.in	\
-	giowin32.c		\
 	glibconfig.h.win32.in	\
-	gwin32.c		\
-	gspawn-win32.c		\
-	gspawn-win32-helper.c	\
 	config.h.win32.in	\
 	build-dll		\
@@ -33,4 +29,7 @@
 	gen-unicode-tables.pl
 
+EXTRA_PROGRAMS = \
+	gspawin-win32-helper
+
 # These may be in the builddir too
 BUILT_EXTRA_DIST = \
@@ -58,5 +57,4 @@
 	ghook.c			\
 	giochannel.c    	\
-	giounix.c       	\
 	glibintl.h		\
 	glist.c			\
@@ -74,5 +72,4 @@
 	gshell.c		\
 	gslist.c		\
-	gspawn.c		\
 	gstrfuncs.c		\
 	gstring.c		\
@@ -90,6 +87,10 @@
 	gutils.c
 
-## If we decide to link in 'alloca.c', this is how to do it
-#libglib_1_3_la_LIBADD = @ALLOCA@
+EXTRA_libglib_1_3_la_SOURCES = \
+	giounix.c	\
+	giowin32.c	\
+	gspawn.c	\
+	gspawn-win32.c	\
+	gwin32.c
 
 glibincludedir=$(includedir)/glib-2.0
@@ -158,17 +159,32 @@
 	CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=glibconfig.h ./config.status
 	echo timestamp > stamp-gc-h
+
+libglib_1_3_la_LIBADD = @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@
+libglib_1_3_la_DEPENDENCIES = @GIO@ @GSPAWN@ @PLATFORMDEP@ 
 
-libglib_1_3_la_LIBADD = @ICONV_LIBS@
 
+if OS_WIN32
+# This requires a very new libtool
+export_symbols = -export-symbols glib.def
+endif
+
 libglib_1_3_la_LDFLAGS = \
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-	-export-dynamic
+	-export-dynamic -no-undefined $(export_symbols)
 
-noinst_PROGRAMS = testglib testgdate testgdateparser timeloop
+if OS_WIN32
+bin_PROGRAMS = gspawn-win32-helper
+gspawn_win32_helper_LDADD = libglib-1.3.la
+endif
+if ENABLE_TIMELOOP
+timeloop = timeloop
+endif
+noinst_PROGRAMS = testglib testgdate testgdateparser $(timeloop)
 testglib_LDADD = libglib-1.3.la
 testgdate_LDADD = libglib-1.3.la
 testgdateparser_LDADD = libglib-1.3.la
+if ENABLE_TIMELOOP
 timeloop_LDADD = libglib-1.3.la
-
+endif
 m4datadir = $(datadir)/aclocal
 m4data_DATA = glib-2.0.m4
Index: configure.in
===================================================================
RCS file: /cvs/gnome/glib/configure.in,v
retrieving revision 1.180
diff -u -2 -r1.180 configure.in
--- configure.in	2001/02/19 06:50:20	1.180
+++ configure.in	2001/02/21 15:46:25
@@ -162,4 +162,7 @@
 fi
 
+AC_CYGWIN
+AC_EXEEXT
+
 # define a MAINT-like variable REBUILD which is set if Perl
 # and awk are found, so autogenerated sources can be rebuilt
@@ -195,6 +198,6 @@
 AC_DEFINE_UNQUOTED(GLIB_LOCALE_DIR,"$GLIB_LOCALE_DIR")
 
-
 dnl Initialize libtool
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 
@@ -271,5 +274,5 @@
 	AC_MSG_CHECKING(for format to printf and scanf a gint64)
 	AC_CACHE_VAL(glib_cv_long_long_format,[
-		for format in ll q; do
+		for format in ll q I64; do
 		  AC_TRY_RUN([#include <stdio.h>  
 			int main()
@@ -286,5 +289,5 @@
 		done])
 	if test -n "$glib_cv_long_long_format"; then
-	  AC_MSG_RESULT(%${glib_cv_long_long_format}i)
+	  AC_MSG_RESULT(%${glib_cv_long_long_format}u)
         else
 	  AC_MSG_RESULT(none)
@@ -621,4 +624,10 @@
 G_MODULE_BROKEN_RTLD_GLOBAL=0
 G_MODULE_HAVE_DLERROR=0
+dnl *** force native WIN32 shared lib loader 
+if test -z "$G_MODULE_IMPL"; then
+  case "$host" in
+  *-*-mingw*|*-*-cygwin*) G_MODULE_IMPL=G_MODULE_IMPL_WIN32 ;;
+  esac
+fi
 dnl *** dlopen() and dlsym() in system libraries
 if test -z "$G_MODULE_IMPL"; then
@@ -725,5 +734,5 @@
 			[glib_cv_uscore=no],
 			[])
-		rm -f plugin.c plugin.o plugin.lo
+		rm -f plugin.c plugin.$ac_objext plugin.lo
 	])
 	if test "x$glib_cv_uscore" = "xyes"; then
@@ -769,4 +778,75 @@
 AC_SUBST(GLIB_DEBUG_FLAGS)
 
+dnl **********************
+dnl *** g_spawn checks ***
+dnl **********************
+
+AC_MSG_CHECKING(for gspawn implementation)
+case "$host" in
+  *-*-mingw*)
+    GSPAWN=gspawn-win32.lo
+    ;;
+  *)
+    GSPAWN=gspawn.lo
+    ;;    
+esac
+AC_MSG_RESULT($GSPAWN)
+AC_SUBST(GSPAWN)
+
+dnl *************************
+dnl *** GIOChannel checks ***
+dnl *************************
+
+AC_MSG_CHECKING(for GIOChannel implementation)
+case "$host" in
+  *-*-mingw*)
+    GIO=giowin32.lo
+    ;;
+  *)
+    GIO=giounix.lo
+    ;;    
+esac
+AC_MSG_RESULT($GIO)
+AC_SUBST(GIO)
+
+dnl ****************************************
+dnl *** platform dependent source checks ***
+dnl ****************************************
+
+AC_MSG_CHECKING(for platform-dependent source)
+case "$host" in
+  *-*-cygwin*|*-*-mingw*)
+    PLATFORMDEP=gwin32.lo
+    ;;
+  *)
+    PLATFORMDEP=
+    ;;    
+esac
+AC_MSG_RESULT($PLATFORMDEP)
+AC_SUBST(PLATFORMDEP)
+
+AC_MSG_CHECKING([whether to compile timeloop])
+case "$host" in
+  *-*-cygwin*|*-*-mingw*)
+    enable_timeloop=no
+    ;;
+  *)
+    enable_timeloop=yes
+    ;;    
+esac
+AC_MSG_RESULT($enable_timeloop)
+AM_CONDITIONAL(ENABLE_TIMELOOP, test x$enable_timeloop = xyes)
+
+AC_MSG_CHECKING([if building for Win32])
+case "$host" in
+  *-*-mingw*)
+    os_win32=yes
+    ;;
+  *)
+    os_win32=no
+    ;;
+esac
+AC_MSG_RESULT($os_win32)
+AM_CONDITIONAL(OS_WIN32, test x$os_win32 = xyes)
 
 dnl ***********************
@@ -939,5 +1019,5 @@
 		;;
              *)
-		for thread_lib in "" pthread pthreads c_r thread dce; do
+		for thread_lib in "" pthread pthread32 pthreads c_r thread dce; do
 			if test x"$thread_lib" = x; then
 				add_thread_lib=""
@@ -1234,4 +1314,21 @@
 	=)
 
+dnl **********************
+dnl *** Win32 API libs ***
+dnl **********************
+
+case $host in
+  *-*-cygwin*)
+	G_LIBS_EXTRA="-luser32 -lwsock32 -lkernel32"
+    ;;
+  *-*-mingw*)
+	G_LIBS_EXTRA="-lwsock32"
+    ;;
+  *)
+	G_LIBS_EXTRA=""
+    ;;
+esac
+AC_SUBST(G_LIBS_EXTRA)
+
 dnl ***********************
 dnl *** Tests for iconv ***
@@ -1814,8 +1911,10 @@
   *-*-cygwin*)
     glib_os="#define G_OS_UNIX
+#define G_PLATFORM_WIN32
 #define G_WITH_CYGWIN"
     ;;
   *-*-mingw*)
-    glib_os="#define G_OS_WIN32"
+    glib_os="#define G_OS_WIN32
+#define G_PLATFORM_WIN32"
     ;;
   *)
Index: gbacktrace.c
===================================================================
RCS file: /cvs/gnome/glib/gbacktrace.c,v
retrieving revision 1.15
diff -u -2 -r1.15 gbacktrace.c
--- gbacktrace.c	2000/07/26 11:01:59	1.15
+++ gbacktrace.c	2001/02/21 15:46:26
@@ -63,4 +63,5 @@
 #  define STRICT		/* Strict typing, please */
 #  include <windows.h>
+#  undef STRICT
 #endif
 
@@ -76,5 +77,7 @@
 
 
+#ifndef G_OS_WIN32
 static void stack_trace (char **args);
+#endif
 
 extern volatile gboolean glib_on_error_halt;
@@ -186,4 +189,6 @@
 }
 
+#ifndef G_OS_WIN32
+
 static gboolean stack_trace_done = FALSE;
 
@@ -197,5 +202,4 @@
 stack_trace (char **args)
 {
-#ifdef G_OS_UNIX
   pid_t pid;
   int in_fd[2];
@@ -292,6 +296,5 @@
   close (out_fd[1]);
   _exit (0);
-#else
-  abort ();
-#endif
 }
+
+#endif /* !G_OS_WIN32 */
Index: gconvert.c
===================================================================
RCS file: /cvs/gnome/glib/gconvert.c,v
retrieving revision 1.13
diff -u -2 -r1.13 gconvert.c
--- gconvert.c	2001/02/13 18:20:13	1.13
+++ gconvert.c	2001/02/21 15:46:27
@@ -29,6 +29,8 @@
 #include "config.h"
 
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
+#define STRICT
 #include <windows.h>
+#undef STRICT
 #endif
 
@@ -522,5 +524,5 @@
 		  GError      **error)
 {
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
 
   gint i, clen, total_len, wclen, first;
@@ -618,5 +620,5 @@
   return result;
 
-#else
+#else  /* !G_PLATFORM_WIN32 */
 
   char *charset, *str;
@@ -629,5 +631,5 @@
   
   return str;
-#endif
+#endif /* !G_PLATFORM_WIN32 */
 }
 
@@ -663,5 +665,5 @@
 		    GError     **error)
 {
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
 
   gint i, mask, clen, mblen;
@@ -765,5 +767,5 @@
   return result;
 
-#else
+#else  /* !G_PLATFORM_WIN32 */
 
   gchar *charset, *str;
@@ -777,5 +779,5 @@
   return str;
   
-#endif
+#endif /* !G_PLATFORM_WIN32 */
 }
 
@@ -810,9 +812,9 @@
 		    GError     **error)
 {
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
   return g_locale_to_utf8 (opsysstring, len,
 			   bytes_read, bytes_written,
 			   error);
-#else
+#else  /* !G_PLATFORM_WIN32 */
   if (getenv ("G_BROKEN_FILENAMES"))
     return g_locale_to_utf8 (opsysstring, len,
@@ -834,5 +836,5 @@
   else
     return g_strndup (opsysstring, len);
-#endif
+#endif /* !G_PLATFORM_WIN32 */
 }
 
@@ -866,9 +868,9 @@
 		      GError     **error)
 {
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
   return g_locale_from_utf8 (utf8string, len,
 			     bytes_read, bytes_written,
 			     error);
-#else
+#else  /* !G_PLATFORM_WIN32 */
   if (getenv ("G_BROKEN_FILENAMES"))
     return g_locale_from_utf8 (utf8string, len,
@@ -890,6 +892,4 @@
   else
     return g_strndup (utf8string, len);
-#endif
+#endif /* !G_PLATFORM_WIN32 */
 }
-
-
Index: gfileutils.c
===================================================================
RCS file: /cvs/gnome/glib/gfileutils.c,v
retrieving revision 1.17
diff -u -2 -r1.17 gfileutils.c
--- gfileutils.c	2001/02/17 23:30:46	1.17
+++ gfileutils.c	2001/02/21 15:46:28
@@ -379,5 +379,6 @@
   gint fd;
   
-  fd = open (filename, O_RDONLY);
+  /* O_BINARY useful on Cygwin */
+  fd = open (filename, O_RDONLY|O_BINARY);
 
   if (fd < 0)
Index: glib.def
===================================================================
RCS file: /cvs/gnome/glib/glib.def,v
retrieving revision 1.63
diff -u -2 -r1.63 glib.def
--- glib.def	2001/02/21 12:41:26	1.63
+++ glib.def	2001/02/21 15:46:29
@@ -130,4 +130,5 @@
 	g_filename_from_utf8
 	g_filename_to_utf8
+	g_find_program_in_path
 	g_free
 	g_get_charset
@@ -233,4 +234,5 @@
 	g_log
 	g_log_default_handler
+	g_log_domain_glib
 	g_log_remove_handler
 	g_log_set_always_fatal
Index: glib.h
===================================================================
RCS file: /cvs/gnome/glib/glib.h,v
retrieving revision 1.213
diff -u -2 -r1.213 glib.h
--- glib.h	2000/12/24 12:11:03	1.213
+++ glib.h	2001/02/21 15:46:29
@@ -69,5 +69,5 @@
 #include <gunicode.h>
 #include <gutils.h>
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
 #include <gwin32.h>
 #endif
Index: gmarkup.h
===================================================================
RCS file: /cvs/gnome/glib/gmarkup.h,v
retrieving revision 1.3
diff -u -2 -r1.3 gmarkup.h
--- gmarkup.h	2000/11/05 18:38:08	1.3
+++ gmarkup.h	2001/02/21 15:46:29
@@ -24,8 +24,5 @@
 #include <gerror.h>
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+G_BEGIN_DECLS
 
 typedef enum
@@ -120,9 +117,6 @@
 gchar* g_markup_escape_text (const gchar *text,
                              gint         length);
-
 
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
 
 #endif /* __G_MARKUP_H__ */
Index: gmessages.c
===================================================================
RCS file: /cvs/gnome/glib/gmessages.c,v
retrieving revision 1.24
diff -u -2 -r1.24 gmessages.c
--- gmessages.c	2001/02/19 21:51:18	1.24
+++ gmessages.c	2001/02/21 15:46:31
@@ -92,4 +92,5 @@
 #  define STRICT
 #  include <windows.h>
+#  undef STRICT
 #  include <process.h>          /* For _getpid() */
 
Index: gmessages.h
===================================================================
RCS file: /cvs/gnome/glib/gmessages.h,v
retrieving revision 1.1
diff -u -2 -r1.1 gmessages.h
--- gmessages.h	2000/10/12 11:52:07	1.1
+++ gmessages.h	2001/02/21 15:46:32
@@ -72,5 +72,5 @@
 /* Logging mechanism
  */
-extern          const gchar             *g_log_domain_glib;
+GLIB_VAR        const gchar             *g_log_domain_glib;
 guint           g_log_set_handler       (const gchar    *log_domain,
                                          GLogLevelFlags  log_levels,
Index: gshell.c
===================================================================
RCS file: /cvs/gnome/glib/gshell.c,v
retrieving revision 1.2
diff -u -2 -r1.2 gshell.c
--- gshell.c	2001/01/16 02:24:23	1.2
+++ gshell.c	2001/02/21 15:46:33
@@ -47,5 +47,5 @@
  */
 
-gboolean 
+static gboolean 
 unquote_string_inplace (gchar* str, gchar** end, GError** err)
 {
Index: gspawn-win32-helper.c
===================================================================
RCS file: /cvs/gnome/glib/gspawn-win32-helper.c,v
retrieving revision 1.1
diff -u -2 -r1.1 gspawn-win32-helper.c
--- gspawn-win32-helper.c	2000/11/28 20:04:08	1.1
+++ gspawn-win32-helper.c	2001/02/21 15:46:33
@@ -20,4 +20,6 @@
  */
 
+#undef G_LOG_DOMAIN
+#include "glib.h"
 #define GSPAWN_HELPER
 #include "gspawn-win32.c"	/* For shared definitions */
Index: gstrfuncs.c
===================================================================
RCS file: /cvs/gnome/glib/gstrfuncs.c,v
retrieving revision 1.50
diff -u -2 -r1.50 gstrfuncs.c
--- gstrfuncs.c	2001/02/17 23:30:46	1.50
+++ gstrfuncs.c	2001/02/21 15:46:35
@@ -678,9 +678,9 @@
 #ifdef HAVE_STRSIGNAL
 #if defined(G_OS_BEOS) || defined(G_WITH_CYGWIN)
-extern const char * strsignal(int);
-#else /* !G_OS_BEOS */
+extern const char *strsignal(int);
+#else
   /* this is declared differently (const) in string.h on BeOS */
   extern char *strsignal (int sig);
-#endif /* !G_OS_BEOS */
+#endif /* !G_OS_BEOS && !G_WITH_CYGWIN */
   return strsignal (signum);
 #elif NO_SYS_SIGLIST
Index: gthread.c
===================================================================
RCS file: /cvs/gnome/glib/gthread.c,v
retrieving revision 1.18
diff -u -2 -r1.18 gthread.c
--- gthread.c	2001/02/19 21:51:18	1.18
+++ gthread.c	2001/02/21 15:46:36
@@ -112,5 +112,5 @@
 gboolean g_threads_got_initialized = FALSE;
 
-#if defined(G_OS_WIN32) && defined(__GNUC__)
+#if defined(G_PLATFORM_WIN32) && defined(__GNUC__)
 __declspec(dllexport)
 #endif
Index: gtimer.c
===================================================================
RCS file: /cvs/gnome/glib/gtimer.c,v
retrieving revision 1.13
diff -u -2 -r1.13 gtimer.c
--- gtimer.c	2000/09/06 13:56:15	1.13
+++ gtimer.c	2001/02/21 15:46:37
@@ -60,4 +60,12 @@
 };
 
+#ifdef G_OS_WIN32
+#  define GETTIME(v) \
+     v = GetTickCount ()
+#else /* !G_OS_WIN32 */
+#  define GETTIME(v) \
+     gettimeofday (&v, NULL)
+#endif /* !G_OS_WIN32 */
+
 GTimer*
 g_timer_new (void)
@@ -68,9 +76,5 @@
   timer->active = TRUE;
 
-#ifdef G_OS_WIN32
-  timer->start = GetTickCount ();
-#else /* !G_OS_WIN32 */
-  gettimeofday (&timer->start, NULL);
-#endif /* !G_OS_WIN32 */
+  GETTIME (timer->start);
 
   return ((GTimer*) timer);
@@ -95,9 +99,5 @@
   rtimer->active = TRUE;
 
-#ifdef G_OS_WIN32
-  rtimer->start = GetTickCount ();
-#else /* !G_OS_WIN32 */
-  gettimeofday (&rtimer->start, NULL);
-#endif /* !G_OS_WIN32 */
+  GETTIME (rtimer->start);
 }
 
@@ -112,9 +112,5 @@
   rtimer->active = FALSE;
 
-#ifdef G_OS_WIN32
-  rtimer->end = GetTickCount ();
-#else /* !G_OS_WIN32 */
-  gettimeofday (&rtimer->end, NULL);
-#endif /* !G_OS_WIN32 */
+  GETTIME(rtimer->end);
 }
 
@@ -128,9 +124,5 @@
   rtimer = (GRealTimer*) timer;
 
-#ifdef G_OS_WIN32
-   rtimer->start = GetTickCount ();
-#else /* !G_OS_WIN32 */
-  gettimeofday (&rtimer->start, NULL);
-#endif /* !G_OS_WIN32 */
+  GETTIME (rtimer->start);
 }
 
@@ -153,8 +145,5 @@
     rtimer->end = GetTickCount ();
 
-  /* Check for wraparound, which happens every 49.7 days.
-   * No, Win95 machines probably are never running for that long,
-   * but NT machines are.
-   */
+  /* Check for wraparound, which happens every 49.7 days. */
   if (rtimer->end < rtimer->start)
     total = (UINT_MAX - (rtimer->start - rtimer->end)) / 1000.0;
Index: gtypes.h
===================================================================
RCS file: /cvs/gnome/glib/gtypes.h,v
retrieving revision 1.6
diff -u -2 -r1.6 gtypes.h
--- gtypes.h	2001/02/10 01:43:25	1.6
+++ gtypes.h	2001/02/21 15:46:38
@@ -328,13 +328,23 @@
  * properly get exported in windows dlls.
  */
-#ifdef G_OS_WIN32
-#  ifdef GLIB_COMPILATION
-#    define GLIB_VAR __declspec(dllexport)
-#  else /* !GLIB_COMPILATION */
-#    define GLIB_VAR extern __declspec(dllimport)
-#  endif /* !GLIB_COMPILATION */
-#else /* !G_OS_WIN32 */
-#  define GLIB_VAR extern
-#endif /* !G_OS_WIN32 */
+#ifndef GLIB_VAR
+#  ifdef G_PLATFORM_WIN32
+#    ifdef GLIB_STATIC_COMPILATION
+#      define GLIB_VAR extern
+#    else /* !GLIB_STATIC_COMPILATION */
+#      ifdef GLIB_COMPILATION
+#        ifdef DLL_EXPORT
+#          define GLIB_VAR __declspec(dllexport)
+#        else /* !DLL_EXPORT */
+#          define GLIB_VAR extern
+#        endif /* !DLL_EXPORT */
+#      else /* !GLIB_COMPILATION */
+#        define GLIB_VAR extern __declspec(dllimport)
+#      endif /* !GLIB_COMPILATION */
+#    endif /* !GLIB_STATIC_COMPILATION */
+#  else /* !G_PLATFORM_WIN32 */
+#    define GLIB_VAR extern
+#  endif /* !G_PLATFORM_WIN32 */
+#endif /* GLIB_VAR */
 
 #endif /* __G_TYPES_H__ */
Index: gunicode.h
===================================================================
RCS file: /cvs/gnome/glib/gunicode.h,v
retrieving revision 1.15
diff -u -2 -r1.15 gunicode.h
--- gunicode.h	2001/02/21 12:41:26	1.15
+++ gunicode.h	2001/02/21 15:46:39
@@ -162,5 +162,5 @@
 /* Array of skip-bytes-per-initial character.
  * We prefix variable declarations so they can
- * properly get exported in windows dlls.
+ * properly get exported in Windows DLLs.
  */
 GLIB_VAR char g_utf8_skip[256];
Index: gutf8.c
===================================================================
RCS file: /cvs/gnome/glib/gutf8.c,v
retrieving revision 1.12
diff -u -2 -r1.12 gutf8.c
--- gutf8.c	2001/01/25 21:16:45	1.12
+++ gutf8.c	2001/02/21 15:46:41
@@ -30,8 +30,9 @@
 #include "glib.h"
 
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
 #include <stdio.h>
 #define STRICT
 #include <windows.h>
+#undef STRICT
 #endif
 
@@ -342,5 +343,5 @@
 #endif
 
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
   if (a && ! *a)
     {
Index: gutils.c
===================================================================
RCS file: /cvs/gnome/glib/gutils.c,v
retrieving revision 1.87
diff -u -2 -r1.87 gutils.c
--- gutils.c	2001/02/21 12:41:26	1.87
+++ gutils.c	2001/02/21 15:46:42
@@ -65,10 +65,14 @@
 #endif
 
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
 #  define STRICT			/* Strict typing, please */
 #  include <windows.h>
+#  undef STRICT
 #  include <ctype.h>
+#endif /* G_PLATFORM_WIN32 */
+
+#ifdef G_OS_WIN32
 #  include <direct.h>
-#endif /* G_OS_WIN32 */
+#endif
 
 #ifdef HAVE_CODESET
@@ -174,4 +178,7 @@
   const gchar *path, *p;
   gchar *name, *freeme;
+#ifdef G_OS_WIN32
+  gchar *path_tmp;
+#endif
   size_t len;
   size_t pathlen;
@@ -179,5 +186,5 @@
   g_return_val_if_fail (program != NULL, NULL);
 
-  if (*program == '/')
+  if (g_path_is_absolute (program))
     {
       if (g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
@@ -188,4 +195,5 @@
   
   path = g_getenv ("PATH");
+#ifdef G_OS_UNIX
   if (path == NULL)
     {
@@ -202,4 +210,21 @@
       path = "/bin:/usr/bin:.";
     }
+#else
+  {
+    gchar *tmp;
+    gchar moddir[PATH_MAX], sysdir[PATH_MAX], windir[PATH_MAX];
+
+    GetModuleFileName (NULL, moddir, sizeof (moddir));
+    tmp = g_path_get_dirname (moddir);
+    GetSystemDirectory (sysdir, sizeof (sysdir));
+    GetWindowsDirectory (windir, sizeof (windir));
+    path_tmp = g_strconcat (tmp, ";.;", sysdir, ";", windir,
+			    (path != NULL ? ";" : NULL),
+			    (path != NULL ? path : NULL),
+			    NULL);
+    g_free (tmp);
+    path = path_tmp;
+  }
+#endif
   
   len = strlen (program) + 1;
@@ -211,5 +236,5 @@
   name = name + pathlen;
   /* And add the slash before the filename  */
-  *name = '/';
+  *name = G_DIR_SEPARATOR;
   
   p = path;
@@ -219,5 +244,5 @@
 
       path = p;
-      p = my_strchrnul (path, ':');
+      p = my_strchrnul (path, G_SEARCHPATH_SEPARATOR);
 
       if (p == path)
@@ -234,4 +259,7 @@
           ret = g_strdup (startp);
           g_free (freeme);
+#ifdef G_OS_WIN32
+	  g_free (path_tmp);
+#endif
           return ret;
         }
@@ -240,4 +268,7 @@
   
   g_free (freeme);
+#ifdef G_OS_WIN32
+  g_free (path_tmp);
+#endif
 
   return NULL;
@@ -460,10 +491,8 @@
 
 #ifdef G_OS_WIN32
+  /* Recognize drive letter on native Windows */
   if (isalpha (file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR)
-    return TRUE;
-
-  if (file_name[0] == G_DIR_SEPARATOR && file_name[1] == G_DIR_SEPARATOR)
     return TRUE;
-#endif
+#endif /* G_OS_WIN32 */
 
   return FALSE;
@@ -475,11 +504,11 @@
   g_return_val_if_fail (file_name != NULL, NULL);
   
-#ifdef G_OS_WIN32
-  /* Skip \\server\share */
+#ifdef G_PLATFORM_WIN32
+  /* Skip \\server\share (Win32) or //server/share (Cygwin) */
   if (file_name[0] == G_DIR_SEPARATOR &&
       file_name[1] == G_DIR_SEPARATOR &&
       file_name[2])
     {
-      gchar *p, *q;
+      gchar *p;
 
       if ((p = strchr (file_name + 2, G_DIR_SEPARATOR)) > file_name + 2 &&
@@ -1002,10 +1031,10 @@
   return g_strdup (result);
 #else
-#ifndef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
+  return g_strdup_printf ("CP%d", GetACP ());
+#else
   /* FIXME: Do something more intelligent based on setlocale (LC_CTYPE, NULL)
    */
   return g_strdup ("ISO-8859-1");
-#else
-  return g_strdup_printf ("CP%d", GetACP ());
 #endif
 #endif
@@ -1017,5 +1046,6 @@
 
 
-#ifdef G_OS_WIN32
+#ifndef GLIB_LOCALE_DIR
+#ifdef G_PLATFORM_WIN32
 
 #define GLIB_LOCALE_DIR					       	\
@@ -1026,5 +1056,6 @@
    "locale")
 
-#endif /* G_OS_WIN32 */
+#endif /* G_PLATFORM_WIN32 */
+#endif /* !GLIB_LOCALE_DIR */
 
 G_CONST_RETURN gchar *
Index: gwin32.c
===================================================================
RCS file: /cvs/gnome/glib/gwin32.c,v
retrieving revision 1.14
diff -u -2 -r1.14 gwin32.c
--- gwin32.c	2001/02/10 00:17:06	1.14
+++ gwin32.c	2001/02/21 15:46:43
@@ -43,5 +43,8 @@
 #define STRICT			/* Strict typing, please */
 #include <windows.h>
+#undef STRICT
+#ifndef G_WITH_CYGWIN
 #include <direct.h>
+#endif
 #include <errno.h>
 #include <ctype.h>
@@ -51,6 +54,12 @@
 
 #include "glib.h"
+
+#ifdef G_WITH_CYGWIN
+#include <sys/cygwin.h>
+#endif
+
+#ifndef G_WITH_CYGWIN
 
-int
+gint
 g_win32_ftruncate (gint  fd,
 		   guint size)
@@ -215,6 +224,7 @@
   return 0;
 }
+#endif
 
-/* Mingw32 headers don't have latest language and sublanguage codes */
+/* Mingw headers don't have latest language and sublanguage codes */
 #ifndef LANG_AFRIKAANS
 #define LANG_AFRIKAANS 0x36
@@ -873,11 +883,22 @@
   if (!GetModuleFileName (hmodule, fn, MAX_PATH))
     return NULL;
+
+#ifdef G_WITH_CYGWIN
+  /* In Cygwin we need to have POSIX paths */
+  {
+    gchar tmp[MAX_PATH];
+
+    cygwin_conv_to_posix_path(fn, tmp);
+    g_free(fn);
+    fn = g_strdup(tmp);
+  }
+#endif
 
-  if ((p = strrchr (fn, '\\')) != NULL)
+  if ((p = strrchr (fn, G_DIR_SEPARATOR)) != NULL)
     *p = '\0';
 
   if (module_name)
     {
-      p = strrchr (fn, '\\');
+      p = strrchr (fn, G_DIR_SEPARATOR);
       if (p && (g_strcasecmp (p + 1, "bin") == 0 ||
 		g_strcasecmp (p + 1, "lib") == 0))
@@ -928,5 +949,4 @@
   gchar *result = NULL;
   gchar *key;
-  char win_dir[MAX_PATH];
   HKEY reg_key = NULL;
   DWORD type;
@@ -1002,5 +1022,6 @@
   prefix = g_win32_get_package_installation_directory (package, dll_name);
 
-  sep = (prefix[strlen (prefix) - 1] == '\\' ? "" : "\\");
+  sep = (prefix[strlen (prefix) - 1] == G_DIR_SEPARATOR ?
+	 "" : G_DIR_SEPARATOR_S);
 
   return g_strconcat (prefix, sep, subdir, NULL);
Index: gwin32.h
===================================================================
RCS file: /cvs/gnome/glib/gwin32.h,v
retrieving revision 1.5
diff -u -2 -r1.5 gwin32.h
--- gwin32.h	2001/02/17 23:30:46	1.5
+++ gwin32.h	2001/02/21 15:46:43
@@ -30,5 +30,5 @@
 #include <gtypes.h>
 
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
 
 /* Windows emulation stubs for common Unix functions
@@ -37,5 +37,7 @@
 G_BEGIN_DECLS
 
+#ifndef MAXPATHLEN
 #define MAXPATHLEN 1024
+#endif
 
 #ifdef _MSC_VER
@@ -43,4 +45,6 @@
 #endif
 
+#ifdef G_OS_WIN32
+
 /*
  * To get prototypes for the following POSIXish functions, you have to
@@ -90,5 +94,5 @@
 
 /* emulation functions */
-extern int	g_win32_ftruncate	(gint		 f,
+gint		g_win32_ftruncate	(gint		 f,
 					 guint		 size);
 DIR*		g_win32_opendir		(const gchar	*dirname);
@@ -97,4 +101,6 @@
 gint		g_win32_closedir  	(DIR		*dir);
 
+#endif /* G_OS_WIN32 */
+
 /* The MS setlocale uses locale names of the form "English_United
  * States.1252" etc. We want the Unixish standard form "en", "zh_TW"
@@ -120,5 +126,5 @@
 G_END_DECLS
 
-#endif	 /* G_OS_WIN32 */
+#endif	 /* G_PLATFORM_WIN32 */
 
 #endif /* __G_WIN32_H__ */
Index: makefile.mingw.in
===================================================================
RCS file: /cvs/gnome/glib/makefile.mingw.in,v
retrieving revision 1.20
diff -u -2 -r1.20 makefile.mingw.in
--- makefile.mingw.in	2001/02/21 12:41:26	1.20
+++ makefile.mingw.in	2001/02/21 15:46:51
@@ -16,5 +16,5 @@
 
 INCLUDES = -I .
-DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG
+DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG -DDLL_EXPORT
 DEPCFLAGS = $(INTL_CFLAGS) $(LIBICONV_CFLAGS)
 
Index: testglib.c
===================================================================
RCS file: /cvs/gnome/glib/testglib.c,v
retrieving revision 1.46
diff -u -2 -r1.46 testglib.c
--- testglib.c	2001/02/21 12:41:26	1.46
+++ testglib.c	2001/02/21 15:46:54
@@ -47,6 +47,6 @@
 #endif
 
-int array[10000];
-gboolean failed = FALSE;
+static int array[10000];
+static gboolean failed = FALSE;
 
 #define	TEST(m,cond)	G_STMT_START { failed = !(cond); \
@@ -352,4 +352,7 @@
     { "c\\\\\\", "c" },
 #endif
+#ifdef G_WITH_CYGWIN
+    { "//server/share///x", "//server/share" },
+#endif
     { ".", "." },
     { "..", "." },
@@ -375,4 +378,7 @@
     { "a\\b", NULL },
 #endif
+#ifdef G_WITH_CYGWIN
+    { "//server/share///x", "//x" },
+#endif
     { ".", NULL },
     { "", NULL },
@@ -394,6 +400,12 @@
   gchar *p;
 #ifdef G_OS_WIN32
-  gchar *glib_dll = g_strdup_printf ("glib-%d.%d.dll",
+  gchar *glib_dll = g_strdup_printf ("glib-%d.%d-%d.dll",
 				     GLIB_MAJOR_VERSION,
+				     GLIB_MINOR_VERSION,
+				     GLIB_MICRO_VERSION);
+#endif
+#ifdef G_WITH_CYGWIN
+  gchar *glib_dll = g_strdup_printf ("cygglib-%d.%d.dll",
+				     GLIB_MAJOR_VERSION,
 				     GLIB_MINOR_VERSION);
 #endif
@@ -1152,5 +1164,5 @@
   g_print ("ok\n");
 
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
   g_print ("current locale: %s\n", g_win32_getlocale ());
 
Index: gmodule/ChangeLog
===================================================================
RCS file: /cvs/gnome/glib/gmodule/ChangeLog,v
retrieving revision 1.47
diff -u -2 -r1.47 ChangeLog
--- gmodule/ChangeLog	2001/02/17 23:30:47	1.47
+++ gmodule/ChangeLog	2001/02/21 15:46:54
@@ -1,2 +1,14 @@
+2001-02-21  Tor Lillqvist  <tml iki fi>
+
+	* gmodule.h: Use G_BEGIN_DECLS and G_END_DECLS. Define
+	G_MODULE_EXPORT correctly on Cygwin, too.
+
+	* gmodule-win32.c (_g_module_open): Convert path to Windows format
+	on Cygwin.
+
+	* Makefile.am (libglib): Use libglib-1.3.la from
+	top_builddir. Invoke libtool with -no-undefined on Win32 and
+	Cygwin.
+
 2001-02-17  Havoc Pennington  <hp pobox com>
 
Index: gmodule/Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/gmodule/Makefile.am,v
retrieving revision 1.24
diff -u -2 -r1.24 Makefile.am
--- gmodule/Makefile.am	2000/10/16 01:02:17	1.24
+++ gmodule/Makefile.am	2001/02/21 15:46:55
@@ -29,5 +29,5 @@
 		gmodule.h
 
-libglib = $(top_builddir)/libglib-1.3.la # -lglib
+libglib = $(top_builddir)/libglib-1.3.la
 
 top_builddir_full=`cd \$(top_builddir); pwd`
@@ -35,21 +35,25 @@
 lib_LTLIBRARIES = libgmodule-1.3.la libgplugin_a.la libgplugin_b.la
 
+if OS_WIN32
+export_symbols = -export-symbols gmodule.def
+endif
+
 libgmodule_1_3_la_SOURCES = gmodule.c
 libgmodule_1_3_la_LDFLAGS = \
 	@G_MODULE_LDFLAGS@ \
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-	-export-dynamic
+	-export-dynamic -no-undefined $(export_symbols)
 
-libgmodule_1_3_la_LIBADD = @G_MODULE_LIBS_EXTRA@ @G_MODULE_LIBS@ # $(libglib)
+libgmodule_1_3_la_LIBADD = @G_MODULE_LIBS_EXTRA@ @G_MODULE_LIBS@ $(libglib)
 # we should really depend on $(libglib) for libgmodule.la, but libtool has a
-# problem with this ;(
+# problem with this ;( Ummm? Does it?
 
 libgplugin_a_la_SOURCES = libgplugin_a.c
-libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
-libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ # $(libglib)
+libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module -no-undefined
+libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ libgmodule-1.3.la $(libglib)
 
 libgplugin_b_la_SOURCES = libgplugin_b.c
-libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
-libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ # $(libglib)
+libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module -no-undefined
+libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ libgmodule-1.3.la $(libglib)
 
 noinst_PROGRAMS = testgmodule
Index: gmodule/gmodule-win32.c
===================================================================
RCS file: /cvs/gnome/glib/gmodule/gmodule-win32.c,v
retrieving revision 1.12
diff -u -2 -r1.12 gmodule-win32.c
--- gmodule/gmodule-win32.c	2000/07/26 11:02:01	1.12
+++ gmodule/gmodule-win32.c	2001/02/21 15:46:55
@@ -39,4 +39,8 @@
 #else
 
+#ifdef G_WITH_CYGWIN
+#include <sys/cygwin.h>
+#endif
+
 /* The w32api headers supplied with the mingw gcc don't have
  * tlhelp32.h. We really only need the MODULEENTRY32 struct and the
@@ -78,4 +82,10 @@
 {
   HINSTANCE handle;
+#ifdef G_WITH_CYGWIN
+  gchar tmp[MAX_PATH];
+
+  cygwin_conv_to_win32_path(file_name, tmp);
+  file_name = tmp;
+#endif
   
   handle = LoadLibrary (file_name);
Index: gmodule/gmodule.h
===================================================================
RCS file: /cvs/gnome/glib/gmodule/gmodule.h,v
retrieving revision 1.19
diff -u -2 -r1.19 gmodule.h
--- gmodule/gmodule.h	2001/02/17 23:30:47	1.19
+++ gmodule/gmodule.h	2001/02/21 15:46:55
@@ -31,7 +31,5 @@
 #include <glib.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /* exporting and importing functions, this is special cased
@@ -39,9 +37,9 @@
  */
 #define	G_MODULE_IMPORT		extern
-#if defined (G_OS_WIN32)
+#ifdef G_PLATFORM_WIN32
 #  define	G_MODULE_EXPORT		__declspec(dllexport)
-#else /* !G_OS_WIN32 */
+#else /* !G_PLATFORM_WIN32 */
 #  define	G_MODULE_EXPORT
-#endif /* !G_OS_WIN32 */
+#endif /* !G_PLATFORM_WIN32 */
 
 typedef enum
@@ -94,8 +92,5 @@
 
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __GMODULE_H__ */
Index: gobject/ChangeLog
===================================================================
RCS file: /cvs/gnome/glib/gobject/ChangeLog,v
retrieving revision 1.75
diff -u -2 -r1.75 ChangeLog
--- gobject/ChangeLog	2001/02/17 23:30:48	1.75
+++ gobject/ChangeLog	2001/02/21 15:46:56
@@ -1,2 +1,9 @@
+2001-02-21  Tor Lillqvist  <tml iki fi>
+
+	* *.h: Use G_BEGIN_DECLS and G_END_DECLS.
+
+	* Makefile.am: Use libglib-1.3.la from top_builddir. Invoke
+	libtool with -no-undefined for Win32 and Cygwin.
+
 2001-02-17  Havoc Pennington  <hp pobox com>
 
Index: gobject/Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/gobject/Makefile.am,v
retrieving revision 1.22
diff -u -2 -r1.22 Makefile.am
--- gobject/Makefile.am	2001/02/03 22:32:10	1.22
+++ gobject/Makefile.am	2001/02/21 15:46:57
@@ -11,14 +11,20 @@
 @STRIP_END@
 
+libglib = $(top_builddir)/libglib-1.3.la
+
 # libraries to compile and install
 lib_LTLIBRARIES = libgobject-1.3.la
 
+if OS_WIN32
+export_symbols = -export-symbols gobject.def
+endif
+
 # libtool stuff: set version and export symbols for resolving
 libgobjectincludedir = $(includedir)/glib-2.0/gobject
 libgobject_1_3_la_LDFLAGS = @STRIP_BEGIN@ \
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)	\
-	-export-dynamic						\
+	-export-dynamic -no-undefined $(export_symbols)		\
 @STRIP_END@
-libgobject_1_3_la_LIBADD = # $(libglib)
+libgobject_1_3_la_LIBADD = $(libglib)
 
 #
@@ -115,5 +121,5 @@
 # srcdir to be writable, passing --disable-rebuilds to
 # ../configure will supress all autogeneration rules.
-$(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal
+$(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal$(EXEEXT)
 	echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
 	&& echo "#define __G_MARSHAL_H__" >> xgen-gmh \
@@ -147,6 +153,6 @@
 glib_genmarshal_SOURCES = glib-genmarshal.c
 # link programs against libgobject
-progs_LDADD = libgobject-1.3.la ../libglib-1.3.la
-glib_genmarshal_LDADD = ../libglib-1.3.la # can't have libgobject here
+progs_LDADD = libgobject-1.3.la $(libglib)
+glib_genmarshal_LDADD = $(libglib)
 gobject_query_LDADD = $(progs_LDADD)
 
Index: gobject/gboxed.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gboxed.h,v
retrieving revision 1.2
diff -u -2 -r1.2 gboxed.h
--- gobject/gboxed.h	2000/10/25 22:33:26	1.2
+++ gobject/gboxed.h	2001/02/21 15:46:57
@@ -22,10 +22,6 @@
 #include        <gobject/gtype.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* --- type macros --- */
 #define G_TYPE_IS_BOXED(type)	(G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED)
@@ -56,11 +52,6 @@
 					 GBoxedCopyFunc	boxed_copy,
 					 GBoxedFreeFunc	boxed_free);
-
-
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif	/* __G_BOXED_H__ */
Index: gobject/gbsearcharray.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gbsearcharray.h,v
retrieving revision 1.2
diff -u -2 -r1.2 gbsearcharray.h
--- gobject/gbsearcharray.h	2000/10/25 23:39:32	1.2
+++ gobject/gbsearcharray.h	2001/02/21 15:46:57
@@ -24,10 +24,6 @@
 #include        <gobject/gtype.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* helper macro to avoid signed overflow for value comparisions */
 #define	G_BSEARCH_ARRAY_CMP(v1,v2) ((v1) < (v2) ? -1 : (v1) > (v2) ? 1 : 0)
@@ -124,11 +120,6 @@
 }
 #endif  /* G_CAN_INLINE && __G_BSEARCHARRAY_C__ */
-
 
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_BSEARCH_ARRAY_H__ */
Index: gobject/gclosure.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gclosure.h,v
retrieving revision 1.5
diff -u -2 -r1.5 gclosure.h
--- gobject/gclosure.h	2001/02/16 07:22:59	1.5
+++ gobject/gclosure.h	2001/02/21 15:46:57
@@ -23,11 +23,6 @@
 #include        <gobject/gtype.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-
 /* --- defines --- */
 #define	G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))->marshal == NULL)
@@ -158,9 +153,6 @@
    - provide marshaller collection, virtually covering anything out there
 */
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_CLOSURE_H__ */
Index: gobject/genums.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/genums.h,v
retrieving revision 1.6
diff -u -2 -r1.6 genums.h
--- gobject/genums.h	2001/02/17 07:00:16	1.6
+++ gobject/genums.h	2001/02/21 15:46:58
@@ -22,10 +22,6 @@
 #include <gobject/gtype.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* --- type macros --- */
 #define G_TYPE_IS_ENUM(type)	       (G_TYPE_FUNDAMENTAL (type) == G_TYPE_ENUM)
@@ -118,10 +114,6 @@
 				    GTypeInfo	      *info,
 				    const GFlagsValue *const_values);
-
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_ENUMS_H__ */
Index: gobject/gobject.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gobject.h,v
retrieving revision 1.9
diff -u -2 -r1.9 gobject.h
--- gobject/gobject.h	2000/12/13 08:36:17	1.9
+++ gobject/gobject.h	2001/02/21 15:46:58
@@ -25,10 +25,6 @@
 #include        <gobject/gclosure.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* --- type macros --- */
 #define G_TYPE_IS_OBJECT(type)     (G_TYPE_FUNDAMENTAL (type) == G_TYPE_OBJECT)
@@ -205,10 +201,6 @@
              G_OBJECT_TYPE_NAME (_object)); \
 } G_STMT_END
-
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_OBJECT_H__ */
Index: gobject/gparam.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gparam.h,v
retrieving revision 1.9
diff -u -2 -r1.9 gparam.h
--- gobject/gparam.h	2001/01/31 06:27:41	1.9
+++ gobject/gparam.h	2001/02/21 15:46:58
@@ -25,10 +25,6 @@
 #include	<gobject/gvalue.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* --- type macros --- */
 #define G_TYPE_IS_PARAM(type)		(G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM)
@@ -184,7 +180,5 @@
  */
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_PARAM_H__ */
Index: gobject/gparamspecs.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gparamspecs.h,v
retrieving revision 1.5
diff -u -2 -r1.5 gparamspecs.h
--- gobject/gparamspecs.h	2000/12/15 05:51:08	1.5
+++ gobject/gparamspecs.h	2001/02/21 15:46:59
@@ -28,10 +28,6 @@
 #include        <gobject/gobject.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* --- type macros --- */
 #define G_IS_PARAM_SPEC_CHAR(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CHAR))
@@ -315,9 +311,6 @@
                                          GType           object_type,
                                          GParamFlags     flags);
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_PARAMSPECS_H__ */
Index: gobject/gsignal.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gsignal.h,v
retrieving revision 1.12
diff -u -2 -r1.12 gsignal.h
--- gobject/gsignal.h	2001/02/17 23:30:48	1.12
+++ gobject/gsignal.h	2001/02/21 15:47:00
@@ -26,10 +26,6 @@
 #include	<gobject/gmarshal.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* --- typedefs --- */
 typedef struct _GSignalQuery		 GSignalQuery;
@@ -215,9 +211,6 @@
 void	 g_signal_handlers_destroy	      (gpointer		  instance);
 void	 _g_signals_destroy		      (GType		  itype);
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_SIGNAL_H__ */
Index: gobject/gtype.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gtype.h,v
retrieving revision 1.18
diff -u -2 -r1.18 gtype.h
--- gobject/gtype.h	2001/02/17 23:30:48	1.18
+++ gobject/gtype.h	2001/02/21 15:47:01
@@ -23,10 +23,6 @@
 #include        <glib.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* Basic Type Macros
  */
@@ -360,9 +356,6 @@
 #define	G_TYPE_FLAG_RESERVED_ID_BIT	(1 << 30)
 extern GTypeDebugFlags			_g_type_debug_flags;
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_TYPE_H__ */
Index: gobject/gtypeplugin.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gtypeplugin.h,v
retrieving revision 1.1
diff -u -2 -r1.1 gtypeplugin.h
--- gobject/gtypeplugin.h	2000/11/05 05:07:26	1.1
+++ gobject/gtypeplugin.h	2001/02/21 15:47:01
@@ -23,11 +23,6 @@
 #include	<gobject/gtype.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-
 /* --- type macros --- */
 #define G_TYPE_TYPE_PLUGIN		(g_type_plugin_get_type ())
@@ -74,12 +69,6 @@
 						 GType            instance_type,
 						 GInterfaceInfo  *info);
-
-
-
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_TYPE_PLUGIN_H__ */
Index: gobject/gvalue.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gvalue.h,v
retrieving revision 1.7
diff -u -2 -r1.7 gvalue.h
--- gobject/gvalue.h	2001/02/17 05:32:00	1.7
+++ gobject/gvalue.h	2001/02/21 15:47:01
@@ -25,9 +25,6 @@
 #include	<gobject/gtype.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
-
 /* --- type macros --- */
 #define	G_TYPE_IS_VALUE(type)		(g_type_value_table_peek (type) != NULL)
@@ -85,7 +82,5 @@
 
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_VALUE_H__ */
Index: gobject/gvaluecollector.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gvaluecollector.h,v
retrieving revision 1.4
diff -u -2 -r1.4 gvaluecollector.h
--- gobject/gvaluecollector.h	2001/02/17 05:32:00	1.4
+++ gobject/gvaluecollector.h	2001/02/21 15:47:01
@@ -22,10 +22,6 @@
 #define __G_VALUE_COLLECTOR_H__
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* we may want to add aggregate types here some day, if requested
  * by users. the basic C types are covered already, everything
@@ -144,10 +140,6 @@
 
 #define	G_VALUE_COLLECT_FORMAT_MAX_LENGTH	(8)
-
-
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_VALUE_COLLECTOR_H__ */
Index: gobject/gvaluetypes.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gvaluetypes.h,v
retrieving revision 1.6
diff -u -2 -r1.6 gvaluetypes.h
--- gobject/gvaluetypes.h	2001/02/17 23:30:48	1.6
+++ gobject/gvaluetypes.h	2001/02/21 15:47:01
@@ -25,10 +25,6 @@
 #include	<gobject/gvalue.h>
 
+G_BEGIN_DECLS
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /* --- type macros --- */
 #define G_IS_VALUE_CHAR(value)		(G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_CHAR))
@@ -90,7 +86,5 @@
 						 gpointer     *callback_data);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_VALUETYPES_H__ */
Index: gthread/ChangeLog
===================================================================
RCS file: /cvs/gnome/glib/gthread/ChangeLog,v
retrieving revision 1.42
diff -u -2 -r1.42 ChangeLog
--- gthread/ChangeLog	2001/02/15 16:43:02	1.42
+++ gthread/ChangeLog	2001/02/21 15:47:02
@@ -1,2 +1,10 @@
+2001-02-21  Tor Lillqvist  <tml iki fi>
+
+	* Makefile.am: Use libglib-1.3.la from top_builddir. Invoke
+	libtool with -no-undefined for Win32 and Cygwin.
+
+	* gthread-impl.c (g_thread_init): Win32 code snippet used also on
+	Cygwin.
+
 2001-02-15  Sebastian Wilhelmi  <wilhelmi ira uka de>
 
Index: gthread/Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/gthread/Makefile.am,v
retrieving revision 1.19
diff -u -2 -r1.19 Makefile.am
--- gthread/Makefile.am	2000/10/25 10:58:46	1.19
+++ gthread/Makefile.am	2001/02/21 15:47:02
@@ -19,5 +19,5 @@
 		gthread.rc
 
-libglib = $(top_builddir)/libglib.la # -lglib
+libglib = $(top_builddir)/libglib-1.3.la
 
 top_builddir_full=`cd \$(top_builddir); pwd`
@@ -25,10 +25,14 @@
 lib_LTLIBRARIES = libgthread-1.3.la
 
+if OS_WIN32
+export_symbols = -export-symbols gthread.def
+endif
+
 libgthread_1_3_la_SOURCES = gthread-impl.c
 libgthread_1_3_la_LDFLAGS = \
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-	-export-dynamic
+	-export-dynamic -no-undefined $(export_symbols)
 
-libgthread_1_3_la_LIBADD = @G_THREAD_LIBS_EXTRA@ @G_THREAD_LIBS@
+libgthread_1_3_la_LIBADD = @G_THREAD_LIBS_EXTRA@ @G_THREAD_LIBS@ $(libglib)
 
 gthread.rc: $(top_builddir)/config.status $(top_srcdir)/gthread/gthread.rc.in
Index: gthread/gthread-impl.c
===================================================================
RCS file: /cvs/gnome/glib/gthread/gthread-impl.c,v
retrieving revision 1.11
diff -u -2 -r1.11 gthread-impl.c
--- gthread/gthread-impl.c	2001/01/30 14:16:56	1.11
+++ gthread/gthread-impl.c	2001/02/21 15:47:03
@@ -319,5 +319,5 @@
     g_thread_use_default_impl = FALSE;
 
-#if defined (G_OS_WIN32) && defined (__GNUC__)
+#if defined (G_PLATFORM_WIN32) && defined (__GNUC__)
   memcpy(&g_thread_functions_for_glib_use, init, sizeof (*init));
 #else
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/tests/Makefile.am,v
retrieving revision 1.31
diff -u -2 -r1.31 Makefile.am
--- tests/Makefile.am	2001/02/03 22:32:10	1.31
+++ tests/Makefile.am	2001/02/21 15:47:03
@@ -4,4 +4,9 @@
 EFENCE=
 
+libglib = $(top_builddir)/libglib-1.3.la
+libgthread = $(top_builddir)/gthread/libgthread-1.3.la
+libgmodule = $(top_builddir)/gmodule/libgmodule-1.3.la
+libgobject = $(top_builddir)/gobject/libgobject-1.3.la
+
 EXTRA_DIST = \
 	$(test_scripts)		\
@@ -10,6 +15,6 @@
 
 BUILT_EXTRA_DIST = \
-	makefile.msc	\
-	makefile.mingw
+	makefile.mingw	\
+	makefile.msc
 
 test_programs = \
@@ -46,7 +51,7 @@
 TESTS_ENVIRONMENT = srcdir=$(srcdir)
 
-progs_LDADD = $(EFENCE) $(top_builddir)/libglib-1.3.la $(EFENCE)
-thread_LDADD = $(top_builddir)/gthread/libgthread-1.3.la @G_THREAD_LIBS@ $(progs_LDADD)
-module_LDADD = $(top_builddir)/gmodule/libgmodule-1.3.la @G_MODULE_LIBS@ $(progs_LDADD)
+progs_LDADD = $(EFENCE) $(libglib) $(EFENCE)
+thread_LDADD = $(libgthread) @G_THREAD_LIBS@ $(progs_LDADD)
+module_LDADD = $(libgmodule) @G_MODULE_LIBS@ $(progs_LDADD)
 
 array_test_LDADD = $(progs_LDADD)
@@ -82,15 +87,15 @@
 
 libmoduletestplugin_a_la_SOURCES = libmoduletestplugin_a.c
-libmoduletestplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
-libmoduletestplugin_a_la_LIBADD = @G_MODULE_LIBS@ 
+libmoduletestplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module -no-undefined
+libmoduletestplugin_a_la_LIBADD = @G_MODULE_LIBS@ $(libgmodule) $(libglib)
 
 libmoduletestplugin_b_la_SOURCES = libmoduletestplugin_b.c
-libmoduletestplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
-libmoduletestplugin_b_la_LIBADD = @G_MODULE_LIBS@  
+libmoduletestplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module -no-undefined
+libmoduletestplugin_b_la_LIBADD = @G_MODULE_LIBS@ $(libgmodule) $(libglib)
 
-makefile.msc: $(top_builddir)/config.status $(top_srcdir)/tests/makefile.msc.in
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/tests/makefile.mingw.in
 	cd $(top_builddir) && CONFIG_FILES=tests/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/tests/makefile.mingw.in
+makefile.msc: $(top_builddir)/config.status $(top_srcdir)/tests/makefile.msc.in
 	cd $(top_builddir) && CONFIG_FILES=tests/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]