From 142219f278b625341a152436ce7fc72670e25bc4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 22 Mar 2000 20:46:19 +0000 Subject: [PATCH] Move Win32-only includes after inclusion of glib.h, so that G_OS_WIN32 is 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so that G_OS_WIN32 is defined. * glibconfig.h.win32.in: Add GSystemThread. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-0 | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-12 | 7 +++++++ ChangeLog.pre-2-2 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ glib/gutils.c | 20 +++++++++----------- glibconfig.h.win32.in | 17 +++++++++++++++-- gutils.c | 20 +++++++++----------- 11 files changed, 89 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5fc5217..e1dac4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-03-22 Tor Lillqvist + + * gutils.c: Move Win32-only includes after inclusion of glib.h, so + that G_OS_WIN32 is defined. + + * glibconfig.h.win32.in: Add GSystemThread. + 2000-03-22 Sebastian Wilhelmi * gutils.c (g_get_current_dir): Ok, Marcus Brinkmann diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 5fc5217..e1dac4c 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +2000-03-22 Tor Lillqvist + + * gutils.c: Move Win32-only includes after inclusion of glib.h, so + that G_OS_WIN32 is defined. + + * glibconfig.h.win32.in: Add GSystemThread. + 2000-03-22 Sebastian Wilhelmi * gutils.c (g_get_current_dir): Ok, Marcus Brinkmann diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5fc5217..e1dac4c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2000-03-22 Tor Lillqvist + + * gutils.c: Move Win32-only includes after inclusion of glib.h, so + that G_OS_WIN32 is defined. + + * glibconfig.h.win32.in: Add GSystemThread. + 2000-03-22 Sebastian Wilhelmi * gutils.c (g_get_current_dir): Ok, Marcus Brinkmann diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 5fc5217..e1dac4c 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +2000-03-22 Tor Lillqvist + + * gutils.c: Move Win32-only includes after inclusion of glib.h, so + that G_OS_WIN32 is defined. + + * glibconfig.h.win32.in: Add GSystemThread. + 2000-03-22 Sebastian Wilhelmi * gutils.c (g_get_current_dir): Ok, Marcus Brinkmann diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 5fc5217..e1dac4c 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +2000-03-22 Tor Lillqvist + + * gutils.c: Move Win32-only includes after inclusion of glib.h, so + that G_OS_WIN32 is defined. + + * glibconfig.h.win32.in: Add GSystemThread. + 2000-03-22 Sebastian Wilhelmi * gutils.c (g_get_current_dir): Ok, Marcus Brinkmann diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 5fc5217..e1dac4c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +2000-03-22 Tor Lillqvist + + * gutils.c: Move Win32-only includes after inclusion of glib.h, so + that G_OS_WIN32 is defined. + + * glibconfig.h.win32.in: Add GSystemThread. + 2000-03-22 Sebastian Wilhelmi * gutils.c (g_get_current_dir): Ok, Marcus Brinkmann diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5fc5217..e1dac4c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +2000-03-22 Tor Lillqvist + + * gutils.c: Move Win32-only includes after inclusion of glib.h, so + that G_OS_WIN32 is defined. + + * glibconfig.h.win32.in: Add GSystemThread. + 2000-03-22 Sebastian Wilhelmi * gutils.c (g_get_current_dir): Ok, Marcus Brinkmann diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5fc5217..e1dac4c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +2000-03-22 Tor Lillqvist + + * gutils.c: Move Win32-only includes after inclusion of glib.h, so + that G_OS_WIN32 is defined. + + * glibconfig.h.win32.in: Add GSystemThread. + 2000-03-22 Sebastian Wilhelmi * gutils.c (g_get_current_dir): Ok, Marcus Brinkmann diff --git a/glib/gutils.c b/glib/gutils.c index aad3192..30c3bb7 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -48,16 +48,6 @@ #include #endif -#ifdef G_OS_WIN32 -# define STRICT /* Strict typing, please */ -# include -# include -# include -# ifdef _MSC_VER -# include -# endif /* _MSC_VER */ -#endif /* G_OS_WIN32 */ - /* implement Glib's inline functions */ #define G_INLINE_FUNC extern @@ -74,6 +64,14 @@ #define G_PATH_LENGTH 2048 #endif +#ifdef G_OS_WIN32 +# define STRICT /* Strict typing, please */ +# include +# include +# include +# include +#endif /* G_OS_WIN32 */ + const guint glib_major_version = GLIB_MAJOR_VERSION; const guint glib_minor_version = GLIB_MINOR_VERSION; const guint glib_micro_version = GLIB_MICRO_VERSION; @@ -481,7 +479,7 @@ g_get_any_init (void) g_free (homepath); } } -#endif /* !G_OS_WIN32 */ +#endif /* G_OS_WIN32 */ #ifdef HAVE_PWD_H { diff --git a/glibconfig.h.win32.in b/glibconfig.h.win32.in index 805e731..4c3be91 100644 --- a/glibconfig.h.win32.in +++ b/glibconfig.h.win32.in @@ -147,8 +147,20 @@ struct _GStaticMutex #define g_static_mutex_get_mutex(mutex) \ (g_thread_use_default_impl ? ((GMutex*) &((mutex)->aligned_pad_u)) : \ g_static_mutex_get_mutex_impl (&((mutex)->runtime_mutex))) - -#define G_BYTE_ORDER G_LITTLE_ENDIAN +/* This represents a system thread as used by the implementation. An + * alien implementaion, as loaded by g_thread_init can only count on + * "sizeof (gpointer)" bytes to store their info. We however need more + * for some of our native implementations. */ +typedef union _GSystemThread GSystemThread; +union _GSystemThread +{ + /* The size of the data array should be sizeof (pthread_t) */ + /* This value corresponds to the 1999-05-30 version of pthreads-win32 */ + char data[4]; + double dummy_double; + void *dummy_pointer; + long dummy_long; +}; #define GINT16_TO_LE(val) ((gint16) (val)) #define GUINT16_TO_LE(val) ((guint16) (val)) @@ -174,6 +186,7 @@ struct _GStaticMutex #define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val)) #define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val)) #define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val)) +#define G_BYTE_ORDER G_LITTLE_ENDIAN #define GLIB_SYSDEF_POLLIN = 1 #define GLIB_SYSDEF_POLLOUT = 4 diff --git a/gutils.c b/gutils.c index aad3192..30c3bb7 100644 --- a/gutils.c +++ b/gutils.c @@ -48,16 +48,6 @@ #include #endif -#ifdef G_OS_WIN32 -# define STRICT /* Strict typing, please */ -# include -# include -# include -# ifdef _MSC_VER -# include -# endif /* _MSC_VER */ -#endif /* G_OS_WIN32 */ - /* implement Glib's inline functions */ #define G_INLINE_FUNC extern @@ -74,6 +64,14 @@ #define G_PATH_LENGTH 2048 #endif +#ifdef G_OS_WIN32 +# define STRICT /* Strict typing, please */ +# include +# include +# include +# include +#endif /* G_OS_WIN32 */ + const guint glib_major_version = GLIB_MAJOR_VERSION; const guint glib_minor_version = GLIB_MINOR_VERSION; const guint glib_micro_version = GLIB_MICRO_VERSION; @@ -481,7 +479,7 @@ g_get_any_init (void) g_free (homepath); } } -#endif /* !G_OS_WIN32 */ +#endif /* G_OS_WIN32 */ #ifdef HAVE_PWD_H { -- 2.7.4