another revision of glib patch for cygwin



Hello,

Here is another version of patch for compiling glib on cygwin for use with
cygwin runtime. Currently the building process is fully done by libtool
and GNU auto* tools. 

With the libtool checkout from previous thuesday it works quite good.
There is only problem with building glib test programs which are located
directly in the glib top directory. It is caused by macro GLIB_VAR which
should be defined to __declspec(dllimport) but is defined to extern
instead. This is currently not possible to workaround while autoconf will
not support use of per target CFLAGS (the test programs should not be
compiled with the -DGLIB_COMPILATION).
Also there is in several places in makefiles used lib*_LIBADD which is
currently suppressed becuase of problem with libtool. With the latest CVS
version worked for me on cygwin and linux flawlessly. The lib*_LIBADD is
required for building cygwin DLL libraries.

I have changed the G_OS_WIN32 || G_WITH_CYGWIN to G_WIN32_PLATFORM as Owen
proposed. In some header files I have replaced

#ifdef __cplusplus
extern "C"
{
#endif
...
#ifdef __cplusplus
}
#endif

with

G_BEGIN_DECLS
...
G_END_DECLS
 

Rest of changes are mostly ifdefs for cygwin.

I will appreciate any comments.

Best regards,
Stevo.

-- 
Stefan Ondrejicka <ondrej idata sk>
Beethovenova 11, 917 08 Trnava, Slovakia
http://www.idata.sk/~ondrej/


diff -ruN glib-cvs07022001/Makefile.am glib/Makefile.am
--- glib-cvs07022001/Makefile.am	Mon Jan 29 11:24:08 2001
+++ glib/Makefile.am	Sun Feb 11 22:07:01 2001
@@ -5,7 +5,7 @@
 SUBDIRS = . gobject gmodule gthread docs tests build
 
 INCLUDES = -DG_LOG_DOMAIN=g_log_domain_glib @GLIB_DEBUG_FLAGS@ \
-	-DG_DISABLE_COMPAT_H
+	-DG_DISABLE_COMPAT_H -DGLIB_COMPILATION
 
 EXTRA_DIST = 			\
 	ChangeLog.pre-1-2	\
@@ -14,6 +14,7 @@
 	acglib.m4		\
 	sanity_check		\
 	README.win32		\
+	README.cygwin		\
 	TODO.xml		\
 	glib.def		\
 	makefile.msc.in		\
@@ -87,7 +88,8 @@
 	gunichartables.h	\
 	gunidecomp.h		\
 	gunidecomp.c		\
-	gutils.c
+	gutils.c		\
+	gwin32.c
 
 ## If we decide to link in 'alloca.c', this is how to do it
 #libglib_1_3_la_LIBADD = @ALLOCA@
@@ -158,7 +160,7 @@
 	CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=glibconfig.h ./config.status
 	echo timestamp > stamp-gc-h
 
-libglib_1_3_la_LIBADD = @ICONV_LIBS@
+libglib_1_3_la_LIBADD = @ICONV_LIBS@ @G_LIBS_EXTRA@
 
 libglib_1_3_la_LDFLAGS = \
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
diff -ruN glib-cvs07022001/README.cygwin glib/README.cygwin
--- glib-cvs07022001/README.cygwin	Thu Jan  1 01:00:00 1970
+++ glib/README.cygwin	Sun Feb 11 22:33:52 2001
@@ -0,0 +1,52 @@
+Glib compilation in cygwin environment
+--------------------------------------
+
+To compile glib DLLs and static libraries for use with cygwin POSIX
+runtime, you need to obtain and build latest libtool from CVS and
+replace in acinclude.m4 file the m4 macros of older libtool version
+with that form the lates CVS. After that you must run libtoolize script.
+Than you can follow with normal auto* based compilation as it is usual
+on UNIX systems. With one exception - the version of libtool I have used,
+complained about unsupported building of DLLs with undefined symbols and
+don't wanted to build the DLLs, even thought all symbols in glib are
+defined and all dependent libraries are supplied for linking. To workaround
+this litle problem is required one small change in ltmain.sh script :
+Change in following part of the script "build_libtool_libs=no" to
+build_libtool_libs=yes".
+
+
+        # Check to see if the archive will have undefined symbols.
+        if test "$allow_undefined" = yes; then
+          if test "$allow_undefined_flag" = unsupported; then
+            $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+            build_libtool_libs=no
+            build_old_libs=yes
+          fi
+        else
+          # Don't allow undefined symbols.
+          allow_undefined_flag="$no_undefined_flag"
+        fi
+
+After that, you can continue regulary with the compilation. The compilation
+will break when linking glib test programs because of undefined libraries.
+In this point it is required to edit Makefile and remove -DGLIB_COMPILATION
+flag from INCLUDES and remove object files of test programs and continue
+with compilation. This is becuase of the GLIB_VAR macro in gtypes.h file
+which is used to export extern variables from DLLs when compiling object 
+files for DLL when GLIB_COMPILATION is defined, but can't be defined when
+compiling sources which should import the variables. Currently this is not
+possible to workaround because of missing support in automake for per target
+compilation flags.
+After this the compilation should without problems.
+
+!!! Warning !!!!
+
+!!! When you want link against static libraries, you must compile files
+!!! which include glib headers with defined GLIB_STATIC_COMPILATION
+!!! (-DGLIB_STATIC_COMPILATION) otherwise the linking stage of your
+!!! program will fail because of undefined symbols when you will use
+!!! variables exported from glib DLLs.
+
+11.02.2001
+-- Stefan Ondrejicka <ondrej idata sk>
+
diff -ruN glib-cvs07022001/configure.in glib/configure.in
--- glib-cvs07022001/configure.in	Fri Feb  2 15:24:36 2001
+++ glib/configure.in	Sun Feb 11 22:36:29 2001
@@ -161,6 +161,9 @@
   fi
 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
 AC_PROG_AWK
@@ -196,6 +199,7 @@
 
 
 dnl Initialize libtool
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 
 if test "x$GCC" = "xyes"; then
@@ -619,6 +623,12 @@
 dnl G_MODULE_IMPL= don't reset, so cmd-line can override
 G_MODULE_NEED_USCORE=0
 G_MODULE_HAVE_DLERROR=0
+dnl *** force native WIN32 shared lib loader 
+if test -z "$G_MODULE_IMPL"; then
+	if test "x$ac_cv_cygwin" = xyes; then
+		G_MODULE_IMPL=G_MODULE_IMPL_WIN32
+	fi
+fi
 dnl *** dlopen() and dlsym() in system libraries
 if test -z "$G_MODULE_IMPL"; then
 	AC_CHECK_FUNC(dlopen,
@@ -1206,6 +1216,19 @@
 	glibconfig-sysdefs.h,
 	=)
 
+case $host in
+  *-*-cygwin* | *-*-mingw*)
+	G_LIBS_EXTRA="-luser32 -lwsock32 -lkernel32"
+    ;;
+  *)
+	G_LIBS_EXTRA=""
+    ;;
+esac
+
+
+AC_SUBST(G_LIBS_EXTRA)
+
+
 dnl ***********************
 dnl *** Tests for iconv ***
 dnl ***********************
@@ -1771,10 +1794,12 @@
     ;;
   *-*-cygwin*)
     glib_os="#define G_OS_UNIX
+#define G_WIN32_PLATFORM
 #define G_WITH_CYGWIN"
     ;;
   *-*-mingw*)
-    glib_os="#define G_OS_WIN32"
+    glib_os="#define G_OS_WIN32
+#define G_WIN32_PLATFORM"
     ;;
   *)
     glib_os="#define G_OS_UNIX"
diff -ruN glib-cvs07022001/gconvert.c glib/gconvert.c
--- glib-cvs07022001/gconvert.c	Mon Jan 29 11:24:13 2001
+++ glib/gconvert.c	Sun Feb 11 22:03:59 2001
@@ -28,7 +28,7 @@
 #include "glib.h"
 #include "config.h"
 
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
 #include <windows.h>
 #endif
 
@@ -516,7 +516,7 @@
 		  gint         *bytes_written,
 		  GError      **error)
 {
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
 
   gint i, clen, total_len, wclen, first;
   wchar_t *wcs, wc;
@@ -612,7 +612,7 @@
   
   return result;
 
-#else
+#else /* !G_WIN32_PLATFORM */
 
   char *charset, *str;
 
@@ -623,7 +623,7 @@
 		   "UTF-8", charset, bytes_read, bytes_written, error);
   
   return str;
-#endif
+#endif /* !G_WIN32_PLATFORM */
 }
 
 /**
@@ -657,7 +657,7 @@
 		    gint        *bytes_written,
 		    GError     **error)
 {
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
 
   gint i, mask, clen, mblen;
   wchar_t *wcs, *wcp;
@@ -759,7 +759,7 @@
   
   return result;
 
-#else
+#else /* !G_WIN32_PLATFORM */
 
   gchar *charset, *str;
 
@@ -771,7 +771,7 @@
 
   return str;
   
-#endif
+#endif /* !G_WIN32_PLATFORM */
 }
 
 /**
@@ -804,11 +804,11 @@
 		    gint        *bytes_written,
 		    GError     **error)
 {
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
   return g_locale_to_utf8 (opsysstring, len,
 			   bytes_read, bytes_written,
 			   error);
-#else
+#else /* !G_WIN32_PLATFORM */
   if (getenv ("G_BROKEN_FILENAMES"))
     return g_locale_to_utf8 (opsysstring, len,
 			     bytes_read, bytes_written,
@@ -828,7 +828,7 @@
     return g_strdup (opsysstring);
   else
     return g_strndup (opsysstring, len);
-#endif
+#endif /* !G_WIN32_PLATFORM */
 }
 
 /**
@@ -860,11 +860,11 @@
 		      gint        *bytes_written,
 		      GError     **error)
 {
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
   return g_locale_from_utf8 (utf8string, len,
 			     bytes_read, bytes_written,
 			     error);
-#else
+#else /* !G_WIN32_PLATFORM */
   if (getenv ("G_BROKEN_FILENAMES"))
     return g_locale_from_utf8 (utf8string, len,
 			       bytes_read, bytes_written,
@@ -884,7 +884,7 @@
     return g_strdup (utf8string);
   else
     return g_strndup (utf8string, len);
-#endif
+#endif /* !G_WIN32_PLATFORM */
 }
 
 
diff -ruN glib-cvs07022001/gfileutils.c glib/gfileutils.c
--- glib-cvs07022001/gfileutils.c	Mon Jan 29 11:24:14 2001
+++ glib/gfileutils.c	Sun Feb 11 22:03:59 2001
@@ -378,7 +378,7 @@
   struct stat stat_buf;
   gint fd;
   
-  fd = open (filename, O_RDONLY);
+  fd = open (filename, O_RDONLY | O_BINARY);
 
   if (fd < 0)
     {
diff -ruN glib-cvs07022001/glib.h glib/glib.h
--- glib-cvs07022001/glib.h	Thu Jan 25 18:42:11 2001
+++ glib/glib.h	Sun Feb 11 22:03:59 2001
@@ -68,7 +68,7 @@
 #include <gtypes.h>
 #include <gunicode.h>
 #include <gutils.h>
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
 #include <gwin32.h>
 #endif
 
diff -ruN glib-cvs07022001/gmarkup.h glib/gmarkup.h
--- glib-cvs07022001/gmarkup.h	Thu Jan 25 18:42:19 2001
+++ glib/gmarkup.h	Sun Feb 11 22:03:59 2001
@@ -23,10 +23,7 @@
 
 #include <gerror.h>
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+G_BEGIN_DECLS
 
 typedef enum
 {
@@ -121,9 +118,7 @@
                              gint         length);
 
 
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
 
 #endif /* __G_MARKUP_H__ */
 
diff -ruN glib-cvs07022001/gmem.h glib/gmem.h
--- glib-cvs07022001/gmem.h	Thu Jan 25 18:42:20 2001
+++ glib/gmem.h	Sun Feb 11 22:03:59 2001
@@ -87,8 +87,8 @@
 
 /* Memory profiler and checker, has to be enabled via g_mem_set_vtable()
  */
-extern GMemVTable	*glib_mem_profiler_table;
-void	g_mem_profile	(void);
+GLIB_VAR	GMemVTable	*glib_mem_profiler_table;
+void		g_mem_profile	(void);
 
 
 /* Memchunk convenience functions
diff -ruN glib-cvs07022001/gmessages.h glib/gmessages.h
--- glib-cvs07022001/gmessages.h	Thu Jan 25 18:42:21 2001
+++ glib/gmessages.h	Sun Feb 11 22:03:59 2001
@@ -71,7 +71,7 @@
 
 /* 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,
                                          GLogFunc        log_func,
diff -ruN glib-cvs07022001/gmodule/Makefile.am glib/gmodule/Makefile.am
--- glib-cvs07022001/gmodule/Makefile.am	Thu Jan 25 19:37:02 2001
+++ glib/gmodule/Makefile.am	Sun Feb 11 22:06:33 2001
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule \
-	-DG_LOG_DOMAIN=g_log_domain_gmodule @GLIB_DEBUG_FLAGS@
+	-DG_LOG_DOMAIN=g_log_domain_gmodule @GLIB_DEBUG_FLAGS@ -DGLIB_COMPILATION
 
 EXTRA_DIST =	\
 		makefile.mingw.in \
@@ -40,17 +40,17 @@
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
 	-export-dynamic
 
-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 ;(
 
 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_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@  $(libglib) libgmodule-1.3.la
 
 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_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@  $(libglib) libgmodule-1.3.la
 
 noinst_PROGRAMS = testgmodule
 testgmodule_LDFLAGS += @G_MODULE_LDFLAGS@
diff -ruN glib-cvs07022001/gmodule/gmodule-win32.c glib/gmodule/gmodule-win32.c
--- glib-cvs07022001/gmodule/gmodule-win32.c	Thu Jan 25 19:37:03 2001
+++ glib/gmodule/gmodule-win32.c	Sun Feb 11 22:03:59 2001
@@ -38,6 +38,10 @@
 #include <tlhelp32.h>
 #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
  * TH32CS_SNAPMODULE value, so provide them here.
@@ -77,6 +81,12 @@
 		gboolean     bind_lazy)
 {
   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);
   if (!handle)
diff -ruN glib-cvs07022001/gmodule/gmodule.h glib/gmodule/gmodule.h
--- glib-cvs07022001/gmodule/gmodule.h	Thu Jan 25 19:37:04 2001
+++ glib/gmodule/gmodule.h	Sun Feb 11 22:03:59 2001
@@ -30,19 +30,17 @@
 extern const char      *g_log_domain_gmodule;
 #include <glib.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 /* exporting and importing functions, this is special cased
  * to feature Windows dll stubs.
  */
 #define	G_MODULE_IMPORT		extern
-#if defined (G_OS_WIN32)
+#ifdef G_WIN32_PLATFORM
 #  define	G_MODULE_EXPORT		__declspec(dllexport)
-#else /* !G_OS_WIN32 */
+#else /* !G_WIN32_PLATFORM */
 #  define	G_MODULE_EXPORT
-#endif /* !G_OS_WIN32 */
+#endif /* !G_WIN32_PLATFORM */
 
 typedef enum
 {
@@ -93,9 +91,6 @@
 gchar*		g_module_build_path	  (const gchar		*directory,
 					   const gchar		*module_name);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif /* __GMODULE_H__ */
diff -ruN glib-cvs07022001/gobject/Makefile.am glib/gobject/Makefile.am
--- glib-cvs07022001/gobject/Makefile.am	Mon Feb  5 10:06:36 2001
+++ glib/gobject/Makefile.am	Sun Feb 11 22:06:42 2001
@@ -8,8 +8,11 @@
 	-I$(top_srcdir)				\
 	-I$(top_builddir)			\
 	@GLIB_DEBUG_FLAGS@			\
+	-DGLIB_COMPILATION			\
 @STRIP_END@
 
+libglib = $(top_builddir)/libglib-1.3.la # -lglib
+
 # libraries to compile and install
 lib_LTLIBRARIES = libgobject-1.3.la
 
@@ -19,7 +22,7 @@
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)	\
 	-export-dynamic						\
 @STRIP_END@
-libgobject_1_3_la_LIBADD = # $(libglib)
+libgobject_1_3_la_LIBADD = $(libglib)
 
 #
 # setup source file variables
@@ -114,7 +117,7 @@
 # versions in the build dir. thus a development setup requires
 # 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 \
 	&& ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
diff -ruN glib-cvs07022001/gobject/gboxed.h glib/gobject/gboxed.h
--- glib-cvs07022001/gobject/gboxed.h	Thu Jan 25 19:37:07 2001
+++ glib/gobject/gboxed.h	Sun Feb 11 22:03:59 2001
@@ -22,10 +22,7 @@
 #include        <gobject/gtype.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+G_BEGIN_DECLS
 
 /* --- type macros --- */
 #define G_TYPE_IS_BOXED(type)	(G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED)
@@ -57,10 +54,6 @@
 					 GBoxedFreeFunc	boxed_free);
 
 
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif	/* __G_BOXED_H__ */
diff -ruN glib-cvs07022001/gobject/gbsearcharray.h glib/gobject/gbsearcharray.h
--- glib-cvs07022001/gobject/gbsearcharray.h	Thu Jan 25 19:37:08 2001
+++ glib/gobject/gbsearcharray.h	Sun Feb 11 22:03:59 2001
@@ -24,10 +24,7 @@
 #include        <gobject/gtype.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+G_BEGIN_DECLS
 
 /* helper macro to avoid signed overflow for value comparisions */
 #define	G_BSEARCH_ARRAY_CMP(v1,v2) ((v1) < (v2) ? -1 : (v1) > (v2) ? 1 : 0)
@@ -125,10 +122,6 @@
 #endif  /* G_CAN_INLINE && __G_BSEARCHARRAY_C__ */
 
 
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_BSEARCH_ARRAY_H__ */
diff -ruN glib-cvs07022001/gobject/gclosure.h glib/gobject/gclosure.h
--- glib-cvs07022001/gobject/gclosure.h	Thu Jan 25 19:37:09 2001
+++ glib/gobject/gclosure.h	Sun Feb 11 22:03:59 2001
@@ -23,10 +23,7 @@
 #include        <gobject/gtype.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+G_BEGIN_DECLS
 
 
 /* --- defines --- */
@@ -158,8 +155,6 @@
 */
 
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_CLOSURE_H__ */
diff -ruN glib-cvs07022001/gobject/genums.h glib/gobject/genums.h
--- glib-cvs07022001/gobject/genums.h	Thu Jan 25 19:37:12 2001
+++ glib/gobject/genums.h	Sun Feb 11 22:03:59 2001
@@ -22,10 +22,7 @@
 #include <gobject/gtype.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+G_BEGIN_DECLS
 
 /* --- type macros --- */
 #define G_TYPE_IS_ENUM(type)	       (G_TYPE_FUNDAMENTAL (type) == G_TYPE_ENUM)
@@ -119,9 +116,6 @@
 				    const GFlagsValue *const_values);
 
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_ENUMS_H__ */
diff -ruN glib-cvs07022001/gobject/gobject.h glib/gobject/gobject.h
--- glib-cvs07022001/gobject/gobject.h	Thu Jan 25 19:37:14 2001
+++ glib/gobject/gobject.h	Sun Feb 11 22:03:59 2001
@@ -25,9 +25,7 @@
 #include        <gobject/gclosure.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 
 /* --- type macros --- */
@@ -206,9 +204,6 @@
 } G_STMT_END
 
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_OBJECT_H__ */
diff -ruN glib-cvs07022001/gobject/gparam.h glib/gobject/gparam.h
--- glib-cvs07022001/gobject/gparam.h	Fri Feb  2 15:24:55 2001
+++ glib/gobject/gparam.h	Sun Feb 11 22:03:59 2001
@@ -25,10 +25,7 @@
 #include	<gobject/gvalue.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+G_BEGIN_DECLS
 
 /* --- type macros --- */
 #define G_TYPE_IS_PARAM(type)		(G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM)
@@ -183,8 +180,7 @@
  *	>0 if value1 > value2, and 0 otherwise (they are equal)
  */
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+
+G_END_DECLS
 
 #endif /* __G_PARAM_H__ */
diff -ruN glib-cvs07022001/gobject/gparamspecs.h glib/gobject/gparamspecs.h
--- glib-cvs07022001/gobject/gparamspecs.h	Thu Jan 25 19:37:16 2001
+++ glib/gobject/gparamspecs.h	Sun Feb 11 22:03:59 2001
@@ -28,9 +28,7 @@
 #include        <gobject/gobject.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 
 /* --- type macros --- */
@@ -315,9 +313,6 @@
                                          GType           object_type,
                                          GParamFlags     flags);
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_PARAMSPECS_H__ */
diff -ruN glib-cvs07022001/gobject/gsignal.h glib/gobject/gsignal.h
--- glib-cvs07022001/gobject/gsignal.h	Thu Jan 25 19:37:18 2001
+++ glib/gobject/gsignal.h	Sun Feb 11 22:03:59 2001
@@ -26,9 +26,7 @@
 #include	<gobject/gmarshal.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 
 /* --- typedefs --- */
@@ -214,8 +212,6 @@
 void	 _g_signals_destroy		      (GType		  itype);
 
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_SIGNAL_H__ */
diff -ruN glib-cvs07022001/gobject/gtype.h glib/gobject/gtype.h
--- glib-cvs07022001/gobject/gtype.h	Mon Feb  5 10:06:54 2001
+++ glib/gobject/gtype.h	Sun Feb 11 22:03:59 2001
@@ -23,9 +23,7 @@
 #include        <glib.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 
 /* Basic Type Macros
@@ -358,8 +356,6 @@
 extern GTypeDebugFlags			_g_type_debug_flags;
 
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_TYPE_H__ */
diff -ruN glib-cvs07022001/gobject/gtypeplugin.h glib/gobject/gtypeplugin.h
--- glib-cvs07022001/gobject/gtypeplugin.h	Thu Jan 25 19:37:22 2001
+++ glib/gobject/gtypeplugin.h	Sun Feb 11 22:03:59 2001
@@ -23,10 +23,7 @@
 #include	<gobject/gtype.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+G_BEGIN_DECLS
 
 
 /* --- type macros --- */
@@ -75,11 +72,6 @@
 						 GInterfaceInfo  *info);
 
 
-
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_TYPE_PLUGIN_H__ */
diff -ruN glib-cvs07022001/gobject/gvalue.h glib/gobject/gvalue.h
--- glib-cvs07022001/gobject/gvalue.h	Thu Jan 25 19:37:22 2001
+++ glib/gobject/gvalue.h	Sun Feb 11 22:03:59 2001
@@ -24,10 +24,8 @@
 
 #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)
@@ -83,8 +81,7 @@
 					 GValueExchange func);
 #define G_VALUE_STATIC_TAG		(1 << 27)
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+
+G_END_DECLS
 
 #endif /* __G_VALUE_H__ */
diff -ruN glib-cvs07022001/gobject/gvaluecollector.h glib/gobject/gvaluecollector.h
--- glib-cvs07022001/gobject/gvaluecollector.h	Thu Jan 25 19:37:22 2001
+++ glib/gobject/gvaluecollector.h	Sun Feb 11 22:03:59 2001
@@ -22,9 +22,7 @@
 #define __G_VALUE_COLLECTOR_H__
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 
 /* we may want to add aggregate types here some day, if requested
@@ -148,9 +146,6 @@
 } G_STMT_END
 
 
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_VALUE_COLLECTOR_H__ */
diff -ruN glib-cvs07022001/gobject/gvaluetypes.h glib/gobject/gvaluetypes.h
--- glib-cvs07022001/gobject/gvaluetypes.h	Thu Jan 25 19:37:23 2001
+++ glib/gobject/gvaluetypes.h	Sun Feb 11 22:03:59 2001
@@ -25,10 +25,7 @@
 #include	<gobject/gvalue.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+G_BEGIN_DECLS
 
 /* --- type macros --- */
 #define G_IS_VALUE_CHAR(value)		(G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_CHAR))
@@ -90,10 +87,6 @@
 						 gpointer	*callback_data);
 
 
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* __G_VALUETYPES_H__ */
diff -ruN glib-cvs07022001/gobject/stamp-gmarshal.h glib/gobject/stamp-gmarshal.h
--- glib-cvs07022001/gobject/stamp-gmarshal.h	Thu Jan  1 01:00:00 1970
+++ glib/gobject/stamp-gmarshal.h	Sun Feb 11 22:03:59 2001
@@ -0,0 +1 @@
+timestamp

diff -ruN glib-cvs07022001/gshell.c glib/gshell.c
--- glib-cvs07022001/gshell.c	Thu Jan 25 18:42:27 2001
+++ glib/gshell.c	Sun Feb 11 21:09:23 2001
@@ -46,7 +46,7 @@
  * Otherwise double quotes preserve things literally.
  */
 
-gboolean 
+static gboolean 
 unquote_string_inplace (gchar* str, gchar** end, GError** err)
 {
   gchar* dest;
diff -ruN glib-cvs07022001/gstrfuncs.c glib/gstrfuncs.c
--- glib-cvs07022001/gstrfuncs.c	Fri Feb  2 15:24:43 2001
+++ glib/gstrfuncs.c	Sun Feb 11 22:03:59 2001
@@ -678,10 +678,10 @@
 #ifdef HAVE_STRSIGNAL
 #if defined(G_OS_BEOS) || defined(G_WITH_CYGWIN)
 extern const char * strsignal(int);
-#else /* !G_OS_BEOS */
+#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
   switch (signum)
diff -ruN glib-cvs07022001/gthread/Makefile.am glib/gthread/Makefile.am
--- glib-cvs07022001/gthread/Makefile.am	Thu Jan 25 19:37:24 2001
+++ glib/gthread/Makefile.am	Sun Feb 11 22:06:47 2001
@@ -2,7 +2,7 @@
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gthread \
 	-DG_LOG_DOMAIN=\"GThread\" @GTHREAD_COMPILE_IMPL_DEFINES@ \
-	@GLIB_DEBUG_FLAGS@
+	@GLIB_DEBUG_FLAGS@ -DGLIB_COMPILATION
 
 EXTRA_DIST =				\
 		makefile.mingw.in	\
@@ -18,7 +18,7 @@
 		makefile.msc		\
 		gthread.rc
 
-libglib = $(top_builddir)/libglib.la # -lglib
+libglib = $(top_builddir)/libglib-1.3.la # -lglib
 
 top_builddir_full=`cd \$(top_builddir); pwd`
 
@@ -29,7 +29,7 @@
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
 	-export-dynamic
 
-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
 	cd $(top_builddir) && CONFIG_FILES=gthread/$@ CONFIG_HEADERS= $(SHELL) ./config.status
diff -ruN glib-cvs07022001/gthread/gthread-impl.c glib/gthread/gthread-impl.c
--- glib-cvs07022001/gthread/gthread-impl.c	Fri Feb  2 15:25:02 2001
+++ glib/gthread/gthread-impl.c	Sun Feb 11 22:03:59 2001
@@ -318,7 +318,7 @@
   else
     g_thread_use_default_impl = FALSE;
 
-#if defined (G_OS_WIN32) && defined (__GNUC__)
+#if defined (G_WIN32_PLATFORM) && defined (__GNUC__)
   memcpy(&g_thread_functions_for_glib_use, init, sizeof (*init));
 #else
   g_thread_functions_for_glib_use = *init;
diff -ruN glib-cvs07022001/gthread.c glib/gthread.c
--- glib-cvs07022001/gthread.c	Fri Feb  2 15:24:44 2001
+++ glib/gthread.c	Sun Feb 11 22:03:59 2001
@@ -86,8 +86,10 @@
 gboolean g_thread_use_default_impl = TRUE;
 gboolean g_threads_got_initialized = FALSE;
 
-#if defined(G_OS_WIN32) && defined(__GNUC__)
+#if !defined(GLIB_STATIC_COMPILATION) || defined(DLL_EXPORT)
+#if defined(G_WIN32_PLATFORM) && defined(__GNUC__)
 __declspec(dllexport)
+#endif
 #endif
 GThreadFunctions g_thread_functions_for_glib_use = {
   (GMutex*(*)())g_thread_fail,                 /* mutex_new */
diff -ruN glib-cvs07022001/gthread.h glib/gthread.h
--- glib-cvs07022001/gthread.h	Fri Feb  2 15:24:44 2001
+++ glib/gthread.h	Sun Feb 11 22:03:59 2001
@@ -28,20 +28,9 @@
 #define __G_THREAD_H__
 
 #include <gerror.h>
+#include <gtypes.h>
 
 G_BEGIN_DECLS
-
-#ifndef GLIB_VAR
-#  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 */
-#endif /* GLIB_VAR */
 
 /* GLib Thread support
  */
diff -ruN glib-cvs07022001/gtimer.c glib/gtimer.c
--- glib-cvs07022001/gtimer.c	Thu Jan 25 19:36:13 2001
+++ glib/gtimer.c	Sun Feb 11 22:03:59 2001
@@ -59,6 +59,14 @@
   guint active : 1;
 };
 
+#ifdef G_OS_WIN32
+#  define G_GET_TIME(v) \
+     v = GetTickCount ()
+#else /* !G_OS_WIN32 */
+#  define G_GET_TIME(v) \
+     gettimeofday (&v, NULL)
+#endif /* !G_OS_WIN32 */
+
 GTimer*
 g_timer_new (void)
 {
@@ -67,11 +75,7 @@
   timer = g_new (GRealTimer, 1);
   timer->active = TRUE;
 
-#ifdef G_OS_WIN32
-  timer->start = GetTickCount ();
-#else /* !G_OS_WIN32 */
-  gettimeofday (&timer->start, NULL);
-#endif /* !G_OS_WIN32 */
+  G_GET_TIME (timer->start);
 
   return ((GTimer*) timer);
 }
@@ -94,11 +98,7 @@
   rtimer = (GRealTimer*) timer;
   rtimer->active = TRUE;
 
-#ifdef G_OS_WIN32
-  rtimer->start = GetTickCount ();
-#else /* !G_OS_WIN32 */
-  gettimeofday (&rtimer->start, NULL);
-#endif /* !G_OS_WIN32 */
+  G_GET_TIME (rtimer->start);
 }
 
 void
@@ -111,11 +111,7 @@
   rtimer = (GRealTimer*) timer;
   rtimer->active = FALSE;
 
-#ifdef G_OS_WIN32
-  rtimer->end = GetTickCount ();
-#else /* !G_OS_WIN32 */
-  gettimeofday (&rtimer->end, NULL);
-#endif /* !G_OS_WIN32 */
+  G_GET_TIME(rtimer->end);
 }
 
 void
@@ -127,11 +123,7 @@
 
   rtimer = (GRealTimer*) timer;
 
-#ifdef G_OS_WIN32
-   rtimer->start = GetTickCount ();
-#else /* !G_OS_WIN32 */
-  gettimeofday (&rtimer->start, NULL);
-#endif /* !G_OS_WIN32 */
+  G_GET_TIME (rtimer->start);
 }
 
 gdouble
diff -ruN glib-cvs07022001/gtypes.h glib/gtypes.h
--- glib-cvs07022001/gtypes.h	Thu Jan 25 19:36:16 2001
+++ glib/gtypes.h	Sun Feb 11 22:27:35 2001
@@ -322,6 +322,26 @@
   glong tv_usec;
 };
 
+#ifndef GLIB_VAR
+#  ifdef G_WIN32_PLATFORM
+#    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_WIN32_PLATFORM */
+#    define GLIB_VAR extern
+#  endif /* !G_WIN32_PLATFORM */
+#endif /* GLIB_VAR */
+
 G_END_DECLS
 
 #endif /* __G_TYPES_H__ */
diff -ruN glib-cvs07022001/gunicode.h glib/gunicode.h
--- glib-cvs07022001/gunicode.h	Thu Jan 25 19:36:18 2001
+++ glib/gunicode.h	Sun Feb 11 22:03:59 2001
@@ -163,17 +163,6 @@
  * We prefix variable declarations so they can
  * properly get exported in windows dlls.
  */
-#ifndef GLIB_VAR
-#  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 */
-#endif /* !GLIB_VAR */
 
 GLIB_VAR char g_utf8_skip[256];
 
diff -ruN glib-cvs07022001/gutf8.c glib/gutf8.c
--- glib-cvs07022001/gutf8.c	Mon Jan 29 11:25:09 2001
+++ glib/gutf8.c	Sun Feb 11 22:03:59 2001
@@ -29,7 +29,7 @@
 
 #include "glib.h"
 
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
 #include <stdio.h>
 #define STRICT
 #include <windows.h>
@@ -341,7 +341,7 @@
     }
 #endif
 
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
   if (a && ! *a)
     {
       static char codepage[10];
diff -ruN glib-cvs07022001/gutils.c glib/gutils.c
--- glib-cvs07022001/gutils.c	Mon Jan 29 11:25:13 2001
+++ glib/gutils.c	Sun Feb 11 22:03:59 2001
@@ -64,9 +64,11 @@
 #define G_PATH_LENGTH   2048
 #endif
 
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
 #  define STRICT			/* Strict typing, please */
 #  include <windows.h>
+#endif /* G_WIN32_PLATFORM */
+#ifdef G_OS_WIN32
 #  include <ctype.h>
 #  include <direct.h>
 #endif /* G_OS_WIN32 */
@@ -470,8 +472,9 @@
 {
   g_return_val_if_fail (file_name != NULL, NULL);
   
-#ifdef G_OS_WIN32
-  /* Skip \\server\share */
+#ifdef G_WIN32_PLATFORM
+  /* G_OS_WIN32         - Skip \\server\share */
+  /* G_WITH_CYGWIN 	- Skip //server/share */
   if (file_name[0] == G_DIR_SEPARATOR &&
       file_name[1] == G_DIR_SEPARATOR &&
       file_name[2])
@@ -988,12 +991,12 @@
   char *result = nl_langinfo (CODESET);
   return g_strdup (result);
 #else
-#ifndef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
+  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
 }
@@ -1002,8 +1005,8 @@
 
 #include <libintl.h>
 
-
-#ifdef G_OS_WIN32
+#ifndef GLIB_LOCALE_DIR
+# ifdef G_WIN32_PLATFORM
 
 #define GLIB_LOCALE_DIR					       	\
   g_win32_get_package_installation_subdirectory			\
@@ -1012,7 +1015,8 @@
 				     GLIB_MINOR_VERSION),	\
    "locale")
 
-#endif /* G_OS_WIN32 */
+#  endif /* G_WIN32_PLATFORM */
+#endif /* !GLIB_LOCALE_DIR */
 
 gchar *
 _glib_gettext (const gchar *str)
diff -ruN glib-cvs07022001/gutils.h glib/gutils.h
--- glib-cvs07022001/gutils.h	Thu Jan 25 19:36:24 2001
+++ glib/gutils.h	Sun Feb 11 22:03:59 2001
@@ -305,15 +305,6 @@
  * we prefix variable declarations so they can
  * 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 */
 
 GLIB_VAR const guint glib_major_version;
 GLIB_VAR const guint glib_minor_version;
diff -ruN glib-cvs07022001/gwin32.c glib/gwin32.c
--- glib-cvs07022001/gwin32.c	Mon Feb  5 14:13:37 2001
+++ glib/gwin32.c	Sun Feb 11 21:09:49 2001
@@ -35,6 +35,8 @@
 
 #include "glibconfig.h"
 
+#ifdef G_WIN32_PLATFORM
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -42,7 +44,9 @@
 
 #define STRICT			/* Strict typing, please */
 #include <windows.h>
+#ifndef G_WITH_CYGWIN
 #include <direct.h>
+#endif
 #include <errno.h>
 #include <ctype.h>
 #ifdef _MSC_VER
@@ -51,6 +55,12 @@
 
 #include "glib.h"
 
+#ifdef G_WITH_CYGWIN
+#include <sys/cygwin.h>
+#endif
+
+#ifndef G_WITH_CYGWIN
+
 int
 g_win32_ftruncate (gint  fd,
 		   guint size)
@@ -214,6 +224,7 @@
 
   return 0;
 }
+#endif
 
 /* Mingw32 headers don't have latest language and sublanguage codes */
 #ifndef LANG_AFRIKAANS
@@ -872,18 +883,28 @@
   if (!GetModuleFileName (hmodule, fn, sizeof (fn)))
     return NULL;
 
-  if ((p = strrchr (fn, '\\')) != NULL)
+#ifdef G_WITH_CYGWIN
+  /* in cygwin we need to have Posix paths not Win32 */
+  {
+    gchar tmp[MAX_PATH];
+
+    cygwin_conv_to_posix_path(fn, tmp);
+    strcpy(fn, tmp);
+  }
+#endif
+
+  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))
 	*p = '\0';
     }
 
-  g_hash_table_insert (module_dirs, module_name ? module_name : "", fn);
+  g_hash_table_insert (module_dirs, module_name ? module_name : "", g_strdup(fn));
 
   return g_strdup (fn);
 }
@@ -1000,7 +1021,9 @@
 
   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);
 }
+
+#endif /* G_WIN32_PLATFORM */
diff -ruN glib-cvs07022001/gwin32.h glib/gwin32.h
--- glib-cvs07022001/gwin32.h	Mon Jan 29 11:25:18 2001
+++ glib/gwin32.h	Sun Feb 11 22:04:11 2001
@@ -29,19 +29,23 @@
 
 #include <gtypes.h>
 
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
 
 /* Windows emulation stubs for common Unix functions
  */
 
 G_BEGIN_DECLS
 
+#ifndef MAXPATHLEN
 #define MAXPATHLEN 1024
+#endif
 
 #ifdef _MSC_VER
 typedef int pid_t;
 #endif
 
+#ifdef G_OS_WIN32
+
 /*
  * To get prototypes for the following POSIXish functions, you have to
  * include the indicated non-POSIX headers. The functions are defined
@@ -89,12 +93,14 @@
 typedef struct DIR DIR;
 
 /* emulation functions */
-extern int	g_win32_ftruncate	(gint		 f,
+gint		g_win32_ftruncate	(gint		 f,
 					 guint		 size);
 DIR*		g_win32_opendir		(const gchar	*dirname);
 struct dirent*	g_win32_readdir  	(DIR		*dir);
 void		g_win32_rewinddir 	(DIR		*dir);
 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"
diff -ruN glib-cvs07022001/testglib.c glib/testglib.c
--- glib-cvs07022001/testglib.c	Mon Jan 29 11:25:24 2001
+++ glib/testglib.c	Sun Feb 11 21:09:34 2001
@@ -347,6 +347,9 @@
     { "a\\b\\", "a\\b" },
     { "c\\\\\\", "c" },
 #endif
+#ifdef G_WITH_CYGWIN
+    { "//server/share///x", "//server/share" },
+#endif
     { ".", "." },
     { "..", "." },
     { "", "." },
@@ -370,6 +373,9 @@
     { "\\\\server\\foo\\bar", "bar" },
     { "a\\b", NULL },
 #endif
+#ifdef G_WITH_CYGWIN
+    { "//server/share///x", "//x" },
+#endif
     { ".", NULL },
     { "", NULL },
   };
@@ -393,6 +399,11 @@
 				     GLIB_MAJOR_VERSION,
 				     GLIB_MINOR_VERSION);
 #endif
+#ifdef G_WITH_CYGWIN
+  gchar *glib_dll = g_strdup_printf ("cygglib-%d.%d.dll",
+				     GLIB_MAJOR_VERSION,
+				     GLIB_MINOR_VERSION);
+#endif
 
   g_print ("TestGLib v%u.%u.%u (i:%u b:%u)\n",
 	   glib_major_version,
@@ -1147,7 +1158,7 @@
 
   g_print ("ok\n");
 
-#ifdef G_OS_WIN32
+#ifdef G_WIN32_PLATFORM
   g_print ("current locale: %s\n", g_win32_getlocale ());
 
   g_print ("GLib installation directory, from Registry entry for %s if available: %s\n",
diff -ruN glib-cvs07022001/tests/Makefile.am glib/tests/Makefile.am
--- glib-cvs07022001/tests/Makefile.am	Mon Feb  5 10:06:54 2001
+++ glib/tests/Makefile.am	Sun Feb 11 21:06:54 2001
@@ -1,8 +1,14 @@
 
-INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule @GLIB_DEBUG_FLAGS@
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule \
+		@GLIB_DEBUG_FLAGS@
 
 EFENCE=
 
+libgthread = $(top_builddir)/gthread/libgthread-1.3.la
+libglib = $(top_builddir)/libglib-1.3.la
+libgmodule = $(top_builddir)/gmodule/libgmodule-1.3.la
+libgobject = $(top_builddir)/gobject/libgobject-1.3.la
+
 EXTRA_DIST = \
 	$(test_scripts)		\
 	makefile.msc.in		\
@@ -46,8 +52,8 @@
 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)
+thread_LDADD = $(libgthread) @G_THREAD_LIBS@ $(progs_LDADD)
+module_LDADD = $(libgmodule) @G_MODULE_LIBS@ $(progs_LDADD)
 
 array_test_LDADD = $(progs_LDADD)
 date_test_LDADD = $(progs_LDADD)
@@ -82,11 +88,11 @@
 
 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_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_LIBADD = @G_MODULE_LIBS@ $(libgmodule) $(libglib)
 
 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]