diff options
author | Manish Singh <yosh@src.gnome.org> | 1999-10-04 02:32:50 +0000 |
---|---|---|
committer | Manish Singh <yosh@src.gnome.org> | 1999-10-04 02:32:50 +0000 |
commit | 7ea73a019935e1118935433c86480acc5eee2e05 (patch) | |
tree | b7afcc4761a189dcea1ce0f405f2a585e624f30c | |
parent | 4944d4df46e31275173c5d559792d21b5839a5cd (diff) | |
download | glib-7ea73a019935e1118935433c86480acc5eee2e05.tar.gz glib-7ea73a019935e1118935433c86480acc5eee2e05.tar.bz2 glib-7ea73a019935e1118935433c86480acc5eee2e05.zip |
G_OS_FOO #defines. I *think* I got the cygwin and beos stuff right, but
I haven't tested it. The respective porters should fix any screwups
-Yosh
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 18 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 18 | ||||
-rw-r--r-- | ChangeLog.pre-2-12 | 18 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 18 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 18 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 18 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 18 | ||||
-rw-r--r-- | acconfig.h | 5 | ||||
-rw-r--r-- | configure.in | 24 | ||||
-rw-r--r-- | gbacktrace.c | 12 | ||||
-rw-r--r-- | gerror.c | 12 | ||||
-rw-r--r-- | glib.h | 18 | ||||
-rw-r--r-- | glib/gbacktrace.c | 12 | ||||
-rw-r--r-- | glib/gerror.c | 12 | ||||
-rw-r--r-- | glib/glib.h | 18 | ||||
-rw-r--r-- | glib/gmain.c | 32 | ||||
-rw-r--r-- | glib/gmessages.c | 6 | ||||
-rw-r--r-- | glib/gscanner.c | 2 | ||||
-rw-r--r-- | glib/gstrfuncs.c | 6 | ||||
-rw-r--r-- | glib/gthread.c | 2 | ||||
-rw-r--r-- | glib/gtimer.c | 50 | ||||
-rw-r--r-- | glib/gutils.c | 34 | ||||
-rw-r--r-- | glibconfig.h.win32.in | 2 | ||||
-rw-r--r-- | gmain.c | 32 | ||||
-rw-r--r-- | gmessages.c | 6 | ||||
-rw-r--r-- | gmodule/ChangeLog | 5 | ||||
-rw-r--r-- | gmodule/gmodule.h | 6 | ||||
-rw-r--r-- | gmodule/testgmodule.c | 6 | ||||
-rw-r--r-- | gscanner.c | 2 | ||||
-rw-r--r-- | gstrfuncs.c | 6 | ||||
-rw-r--r-- | gthread.c | 2 | ||||
-rw-r--r-- | gthread/gthread-impl.c | 2 | ||||
-rw-r--r-- | gtimer.c | 50 | ||||
-rw-r--r-- | gutils.c | 34 | ||||
-rw-r--r-- | testglib.c | 4 | ||||
-rw-r--r-- | tests/testglib.c | 4 |
37 files changed, 344 insertions, 206 deletions
@@ -1,3 +1,21 @@ +Sun Oct 3 19:25:42 PDT 1999 Manish Singh <yosh@gimp.org> + + * acconfig.h + * configure.in + * glibconfig.h.win32: G_OS_FOO #defines. I *think* I got the cygwin + and beos stuff right, but I haven't tested it. The respective + porters should fix any screwups + + * glib.h + * gerror.c + * gmain.c + * gmessages.c + * gscanner.c + * gthread.c + * gtimer.c + * gutils.c + * testglib.c: use G_OS stuff + Wed Sep 22 01:53:18 1999 Tim Janik <timj@gtk.org> * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0962bd9da..bc5a624e9 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,21 @@ +Sun Oct 3 19:25:42 PDT 1999 Manish Singh <yosh@gimp.org> + + * acconfig.h + * configure.in + * glibconfig.h.win32: G_OS_FOO #defines. I *think* I got the cygwin + and beos stuff right, but I haven't tested it. The respective + porters should fix any screwups + + * glib.h + * gerror.c + * gmain.c + * gmessages.c + * gscanner.c + * gthread.c + * gtimer.c + * gutils.c + * testglib.c: use G_OS stuff + Wed Sep 22 01:53:18 1999 Tim Janik <timj@gtk.org> * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0962bd9da..bc5a624e9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,21 @@ +Sun Oct 3 19:25:42 PDT 1999 Manish Singh <yosh@gimp.org> + + * acconfig.h + * configure.in + * glibconfig.h.win32: G_OS_FOO #defines. I *think* I got the cygwin + and beos stuff right, but I haven't tested it. The respective + porters should fix any screwups + + * glib.h + * gerror.c + * gmain.c + * gmessages.c + * gscanner.c + * gthread.c + * gtimer.c + * gutils.c + * testglib.c: use G_OS stuff + Wed Sep 22 01:53:18 1999 Tim Janik <timj@gtk.org> * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 0962bd9da..bc5a624e9 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,21 @@ +Sun Oct 3 19:25:42 PDT 1999 Manish Singh <yosh@gimp.org> + + * acconfig.h + * configure.in + * glibconfig.h.win32: G_OS_FOO #defines. I *think* I got the cygwin + and beos stuff right, but I haven't tested it. The respective + porters should fix any screwups + + * glib.h + * gerror.c + * gmain.c + * gmessages.c + * gscanner.c + * gthread.c + * gtimer.c + * gutils.c + * testglib.c: use G_OS stuff + Wed Sep 22 01:53:18 1999 Tim Janik <timj@gtk.org> * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0962bd9da..bc5a624e9 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,21 @@ +Sun Oct 3 19:25:42 PDT 1999 Manish Singh <yosh@gimp.org> + + * acconfig.h + * configure.in + * glibconfig.h.win32: G_OS_FOO #defines. I *think* I got the cygwin + and beos stuff right, but I haven't tested it. The respective + porters should fix any screwups + + * glib.h + * gerror.c + * gmain.c + * gmessages.c + * gscanner.c + * gthread.c + * gtimer.c + * gutils.c + * testglib.c: use G_OS stuff + Wed Sep 22 01:53:18 1999 Tim Janik <timj@gtk.org> * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0962bd9da..bc5a624e9 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,21 @@ +Sun Oct 3 19:25:42 PDT 1999 Manish Singh <yosh@gimp.org> + + * acconfig.h + * configure.in + * glibconfig.h.win32: G_OS_FOO #defines. I *think* I got the cygwin + and beos stuff right, but I haven't tested it. The respective + porters should fix any screwups + + * glib.h + * gerror.c + * gmain.c + * gmessages.c + * gscanner.c + * gthread.c + * gtimer.c + * gutils.c + * testglib.c: use G_OS stuff + Wed Sep 22 01:53:18 1999 Tim Janik <timj@gtk.org> * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0962bd9da..bc5a624e9 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,21 @@ +Sun Oct 3 19:25:42 PDT 1999 Manish Singh <yosh@gimp.org> + + * acconfig.h + * configure.in + * glibconfig.h.win32: G_OS_FOO #defines. I *think* I got the cygwin + and beos stuff right, but I haven't tested it. The respective + porters should fix any screwups + + * glib.h + * gerror.c + * gmain.c + * gmessages.c + * gscanner.c + * gthread.c + * gtimer.c + * gutils.c + * testglib.c: use G_OS stuff + Wed Sep 22 01:53:18 1999 Tim Janik <timj@gtk.org> * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0962bd9da..bc5a624e9 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,21 @@ +Sun Oct 3 19:25:42 PDT 1999 Manish Singh <yosh@gimp.org> + + * acconfig.h + * configure.in + * glibconfig.h.win32: G_OS_FOO #defines. I *think* I got the cygwin + and beos stuff right, but I haven't tested it. The respective + porters should fix any screwups + + * glib.h + * gerror.c + * gmain.c + * gmessages.c + * gscanner.c + * gthread.c + * gtimer.c + * gutils.c + * testglib.c: use G_OS stuff + Wed Sep 22 01:53:18 1999 Tim Janik <timj@gtk.org> * glib.h (NULL): define NULL as (0L) if __cplusplus is defined, to diff --git a/acconfig.h b/acconfig.h index 20afa6d67..f0b6937b9 100644 --- a/acconfig.h +++ b/acconfig.h @@ -95,16 +95,11 @@ #undef GLIB_INTERFACE_AGE #undef GLIB_BINARY_AGE -#undef WIN32 -#undef NATIVE_WIN32 - #undef G_THREAD_SOURCE #undef POSIX_MIN_PRIORITY #undef POSIX_MAX_PRIORITY #undef POSIX_YIELD_FUNC -#undef GLIB_NATIVE_BEOS - /* #undef PACKAGE */ /* #undef VERSION */ diff --git a/configure.in b/configure.in index 8e65464ff..39e31d9cd 100644 --- a/configure.in +++ b/configure.in @@ -82,15 +82,13 @@ AC_CANONICAL_HOST AC_MSG_CHECKING(for the BeOS) case $host in *-*-beos*) - AC_DEFINE(GLIB_NATIVE_BEOS, 1) glib_native_beos="yes" - AC_MSG_RESULT([$glib_native_beos]) ;; - default) + *) glib_native_beos="no" - AC_MSG_RESULT($glib_native_beos) ;; esac +AC_MSG_RESULT([$glib_native_beos]) dnl figure debugging default, prior to $ac_help setup dnl @@ -1114,6 +1112,7 @@ _______EOF $glib_atexit $glib_memmove $glib_defines +$glib_os $glib_vacopy @@ -1213,6 +1212,7 @@ _______EOF fi cat >>$outfile <<_______EOF + #ifdef __cplusplus } #endif /* __cplusplus */ @@ -1428,10 +1428,18 @@ g_mutex_sizeof="$glib_cv_sizeof_gmutex" g_mutex_contents="$glib_cv_byte_contents_gmutex" g_recmutex_contents="$glib_cv_byte_contents_grecmutex" -if test "x$glib_native_beos" = "xyes"; then - glib_native_beos_def="\$glib_native_beos_def -#define GLIB_NATIVE_BEOS 1" -fi +case $host in + *-*-beos*) + glib_os="#define G_OS_BEOS" + ;; + *-*-cygwin*) + glib_os="#define G_OS_UNIX +#define G_OS_FEATURE_CYGWIN" + ;; + *) + glib_os="#define G_OS_UNIX" + ;; +esac ]) AC_OUTPUT([ diff --git a/gbacktrace.c b/gbacktrace.c index d39cb2c30..89118d422 100644 --- a/gbacktrace.c +++ b/gbacktrace.c @@ -59,7 +59,7 @@ #include <string.h> /* for bzero on BSD systems */ #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT /* Strict typing, please */ # include <windows.h> # include <process.h> /* For _getpid() */ @@ -84,7 +84,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 static const gchar *query1 = "[E]xit, [H]alt"; static const gchar *query2 = ", show [S]tack trace"; static const gchar *query3 = " or [P]roceed"; @@ -111,14 +111,10 @@ g_on_error_query (const gchar *prg_name) query3); fflush (stdout); -#ifndef NATIVE_WIN32 if (isatty(0) && isatty(1)) fgets (buf, 8, stdin); else strcpy (buf, "E\n"); -#else - fgets (buf, 8, stdin); -#endif if ((buf[0] == 'E' || buf[0] == 'e') && buf[1] == '\n') @@ -157,7 +153,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#if !defined(NATIVE_WIN32) && ! defined(GLIB_NATIVE_BEOS) +#ifdef G_OS_UNIX pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -201,7 +197,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#if !defined(NATIVE_WIN32) && !defined(GLIB_NATIVE_BEOS) +#ifdef G_OS_UNIX pid_t pid; int in_fd[2]; int out_fd[2]; @@ -59,7 +59,7 @@ #include <string.h> /* for bzero on BSD systems */ #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT /* Strict typing, please */ # include <windows.h> # include <process.h> /* For _getpid() */ @@ -84,7 +84,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 static const gchar *query1 = "[E]xit, [H]alt"; static const gchar *query2 = ", show [S]tack trace"; static const gchar *query3 = " or [P]roceed"; @@ -111,14 +111,10 @@ g_on_error_query (const gchar *prg_name) query3); fflush (stdout); -#ifndef NATIVE_WIN32 if (isatty(0) && isatty(1)) fgets (buf, 8, stdin); else strcpy (buf, "E\n"); -#else - fgets (buf, 8, stdin); -#endif if ((buf[0] == 'E' || buf[0] == 'e') && buf[1] == '\n') @@ -157,7 +153,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#if !defined(NATIVE_WIN32) && ! defined(GLIB_NATIVE_BEOS) +#ifdef G_OS_UNIX pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -201,7 +197,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#if !defined(NATIVE_WIN32) && !defined(GLIB_NATIVE_BEOS) +#ifdef G_OS_UNIX pid_t pid; int in_fd[2]; int out_fd[2]; @@ -72,7 +72,7 @@ #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 /* On native Win32, directory separator is the backslash, and search path * separator is the semicolon. @@ -82,7 +82,7 @@ #define G_SEARCHPATH_SEPARATOR ';' #define G_SEARCHPATH_SEPARATOR_S ";" -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ /* Unix */ @@ -91,7 +91,7 @@ #define G_SEARCHPATH_SEPARATOR ':' #define G_SEARCHPATH_SEPARATOR_S ":" -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ #ifdef __cplusplus extern "C" { @@ -659,15 +659,15 @@ typedef gint32 GTime; * we prefix variable declarations so they can * properly get exported in windows dlls. */ -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # ifdef GLIB_COMPILATION # define GUTILS_C_VAR __declspec(dllexport) # else /* !GLIB_COMPILATION */ # define GUTILS_C_VAR extern __declspec(dllimport) # endif /* !GLIB_COMPILATION */ -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ # define GUTILS_C_VAR extern -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ GUTILS_C_VAR const guint glib_major_version; GUTILS_C_VAR const guint glib_minor_version; @@ -2692,7 +2692,7 @@ void g_main_set_poll_func (GPollFunc func); GIOChannel* g_io_channel_unix_new (int fd); gint g_io_channel_unix_get_fd (GIOChannel *channel); -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 GUTILS_C_VAR guint g_pipe_readable_msg; @@ -2750,7 +2750,7 @@ GIOChannel *g_io_channel_win32_new_stream_socket (int socket); /* Windows emulation stubs for common Unix functions */ -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define MAXPATHLEN 1024 #ifdef _MSC_VER @@ -2814,7 +2814,7 @@ DIR* gwin_opendir (const gchar *dirname); struct dirent* gwin_readdir (DIR *dir); void gwin_rewinddir (DIR *dir); gint gwin_closedir (DIR *dir); -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ /* GLib Thread support diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c index d39cb2c30..89118d422 100644 --- a/glib/gbacktrace.c +++ b/glib/gbacktrace.c @@ -59,7 +59,7 @@ #include <string.h> /* for bzero on BSD systems */ #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT /* Strict typing, please */ # include <windows.h> # include <process.h> /* For _getpid() */ @@ -84,7 +84,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 static const gchar *query1 = "[E]xit, [H]alt"; static const gchar *query2 = ", show [S]tack trace"; static const gchar *query3 = " or [P]roceed"; @@ -111,14 +111,10 @@ g_on_error_query (const gchar *prg_name) query3); fflush (stdout); -#ifndef NATIVE_WIN32 if (isatty(0) && isatty(1)) fgets (buf, 8, stdin); else strcpy (buf, "E\n"); -#else - fgets (buf, 8, stdin); -#endif if ((buf[0] == 'E' || buf[0] == 'e') && buf[1] == '\n') @@ -157,7 +153,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#if !defined(NATIVE_WIN32) && ! defined(GLIB_NATIVE_BEOS) +#ifdef G_OS_UNIX pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -201,7 +197,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#if !defined(NATIVE_WIN32) && !defined(GLIB_NATIVE_BEOS) +#ifdef G_OS_UNIX pid_t pid; int in_fd[2]; int out_fd[2]; diff --git a/glib/gerror.c b/glib/gerror.c index d39cb2c30..89118d422 100644 --- a/glib/gerror.c +++ b/glib/gerror.c @@ -59,7 +59,7 @@ #include <string.h> /* for bzero on BSD systems */ #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT /* Strict typing, please */ # include <windows.h> # include <process.h> /* For _getpid() */ @@ -84,7 +84,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 static const gchar *query1 = "[E]xit, [H]alt"; static const gchar *query2 = ", show [S]tack trace"; static const gchar *query3 = " or [P]roceed"; @@ -111,14 +111,10 @@ g_on_error_query (const gchar *prg_name) query3); fflush (stdout); -#ifndef NATIVE_WIN32 if (isatty(0) && isatty(1)) fgets (buf, 8, stdin); else strcpy (buf, "E\n"); -#else - fgets (buf, 8, stdin); -#endif if ((buf[0] == 'E' || buf[0] == 'e') && buf[1] == '\n') @@ -157,7 +153,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#if !defined(NATIVE_WIN32) && ! defined(GLIB_NATIVE_BEOS) +#ifdef G_OS_UNIX pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -201,7 +197,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#if !defined(NATIVE_WIN32) && !defined(GLIB_NATIVE_BEOS) +#ifdef G_OS_UNIX pid_t pid; int in_fd[2]; int out_fd[2]; diff --git a/glib/glib.h b/glib/glib.h index 41b9477f2..dba5629c7 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -72,7 +72,7 @@ #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 /* On native Win32, directory separator is the backslash, and search path * separator is the semicolon. @@ -82,7 +82,7 @@ #define G_SEARCHPATH_SEPARATOR ';' #define G_SEARCHPATH_SEPARATOR_S ";" -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ /* Unix */ @@ -91,7 +91,7 @@ #define G_SEARCHPATH_SEPARATOR ':' #define G_SEARCHPATH_SEPARATOR_S ":" -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ #ifdef __cplusplus extern "C" { @@ -659,15 +659,15 @@ typedef gint32 GTime; * we prefix variable declarations so they can * properly get exported in windows dlls. */ -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # ifdef GLIB_COMPILATION # define GUTILS_C_VAR __declspec(dllexport) # else /* !GLIB_COMPILATION */ # define GUTILS_C_VAR extern __declspec(dllimport) # endif /* !GLIB_COMPILATION */ -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ # define GUTILS_C_VAR extern -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ GUTILS_C_VAR const guint glib_major_version; GUTILS_C_VAR const guint glib_minor_version; @@ -2692,7 +2692,7 @@ void g_main_set_poll_func (GPollFunc func); GIOChannel* g_io_channel_unix_new (int fd); gint g_io_channel_unix_get_fd (GIOChannel *channel); -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 GUTILS_C_VAR guint g_pipe_readable_msg; @@ -2750,7 +2750,7 @@ GIOChannel *g_io_channel_win32_new_stream_socket (int socket); /* Windows emulation stubs for common Unix functions */ -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define MAXPATHLEN 1024 #ifdef _MSC_VER @@ -2814,7 +2814,7 @@ DIR* gwin_opendir (const gchar *dirname); struct dirent* gwin_readdir (DIR *dir); void gwin_rewinddir (DIR *dir); gint gwin_closedir (DIR *dir); -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ /* GLib Thread support diff --git a/glib/gmain.c b/glib/gmain.c index 20b1afb91..7a08bc110 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -54,14 +54,14 @@ #endif /* HAVE_UNISTD_H */ #include <errno.h> -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 #define STRICT #include <windows.h> -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ -#ifdef GLIB_NATIVE_BEOS +#ifdef G_OS_BEOS #include <net/socket.h> -#endif /* GLIB_NATIVE_BEOS */ +#endif /* G_OS_BEOS */ /* Types */ @@ -168,13 +168,13 @@ static GMemChunk *poll_chunk; static guint n_poll_records = 0; #ifdef G_THREADS_ENABLED -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 /* this pipe is used to wake up the main loop when a source is added. */ static gint wake_up_pipe[2] = { -1, -1 }; -#else /* NATIVE_WIN32 */ +#else /* G_OS_WIN32 */ static HANDLE wake_up_semaphore = NULL; -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ static GPollFD wake_up_rec; static gboolean poll_waiting = FALSE; @@ -189,7 +189,7 @@ extern gint poll (GPollFD *ufds, guint nfsd, gint timeout); # endif /* !sun */ static GPollFunc poll_func = (GPollFunc) poll; #else /* !HAVE_POLL */ -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 static gint g_poll (GPollFD *fds, guint nfds, gint timeout) @@ -327,7 +327,7 @@ g_poll (GPollFD *fds, guint nfds, gint timeout) return 1; } -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ /* The following implementation of poll() comes from the GNU C Library. * Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. @@ -339,9 +339,9 @@ g_poll (GPollFD *fds, guint nfds, gint timeout) #include <sys/select.h> #endif /* HAVE_SYS_SELECT_H */ -#ifdef GLIB_NATIVE_BEOS +#ifdef G_OS_BEOS #undef NO_FD_SET -#endif /* GLIB_NATIVE_BEOS */ +#endif /* G_OS_BEOS */ #ifndef NO_FD_SET # define SELECT_MASK fd_set @@ -407,7 +407,7 @@ g_poll (GPollFD *fds, return ready; } -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ static GPollFunc poll_func = g_poll; #endif /* !HAVE_POLL */ @@ -591,7 +591,7 @@ g_source_remove_by_funcs_user_data (GSourceFuncs *funcs, void g_get_current_time (GTimeVal *result) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 struct timeval r; g_return_if_fail (result != NULL); @@ -974,7 +974,7 @@ g_main_poll (gint timeout, gint npoll; #ifdef G_THREADS_ENABLED -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 if (wake_up_pipe[0] < 0) { if (pipe (wake_up_pipe) < 0) @@ -1074,7 +1074,7 @@ g_main_poll (gint timeout, #ifdef G_THREADS_ENABLED if (!poll_waiting) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 gchar c; read (wake_up_pipe[0], &c, 1); #endif @@ -1222,7 +1222,7 @@ g_main_wakeup (void) if (poll_waiting) { poll_waiting = FALSE; -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 write (wake_up_pipe[1], "A", 1); #else ReleaseSemaphore (wake_up_semaphore, 1, NULL); diff --git a/glib/gmessages.c b/glib/gmessages.c index 786f76808..4179f73f9 100644 --- a/glib/gmessages.c +++ b/glib/gmessages.c @@ -42,7 +42,7 @@ #endif #include <signal.h> -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT # include <windows.h> # include <process.h> /* For _getpid() */ @@ -424,7 +424,7 @@ g_log_default_handler (const gchar *log_domain, const gchar *message, gpointer unused_data) { -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 FILE *fd; #else gint fd; @@ -450,7 +450,7 @@ g_log_default_handler (const gchar *log_domain, else sprintf (prg_pid, " (pid:%u): ", getpid ()); -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 /* Use just stdout as stderr is hard to get redirected from the * DOS prompt. */ diff --git a/glib/gscanner.c b/glib/gscanner.c index 7d106e4a5..fdbdbf278 100644 --- a/glib/gscanner.c +++ b/glib/gscanner.c @@ -48,7 +48,7 @@ #include <errno.h> #include <sys/types.h> /* needed for sys/stat.h */ #include <sys/stat.h> -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 #include <io.h> /* For _read() */ #endif diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index e8cc1bae2..c8bf80f51 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -669,12 +669,12 @@ g_strsignal (gint signum) char *msg; #ifdef HAVE_STRSIGNAL -#ifdef GLIB_NATIVE_BEOS +#ifdef G_OS_BEOS extern const char * strsignal(int); -#else /* !GLIB_NATIVE_BEOS */ +#else /* !G_OS_BEOS */ /* this is declared differently (const) in string.h on BeOS */ extern char *strsignal (int sig); -#endif /* !GLIB_NATIVE_BEOS */ +#endif /* !G_OS_BEOS */ return strsignal (signum); #elif NO_SYS_SIGLIST switch (signum) diff --git a/glib/gthread.c b/glib/gthread.c index f893a9708..d0d8c7ab3 100644 --- a/glib/gthread.c +++ b/glib/gthread.c @@ -66,7 +66,7 @@ static void g_thread_fail (void); gboolean g_thread_use_default_impl = TRUE; gboolean g_threads_got_initialized = FALSE; -#if defined(NATIVE_WIN32) && defined(__GNUC__) +#if defined(G_OS_WIN32) && defined(__GNUC__) __declspec(dllexport) #endif GThreadFunctions g_thread_functions_for_glib_use = { diff --git a/glib/gtimer.c b/glib/gtimer.c index f4b02c19a..6850e585a 100644 --- a/glib/gtimer.c +++ b/glib/gtimer.c @@ -36,25 +36,25 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif /* HAVE_UNISTD_H */ -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 #include <sys/time.h> -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 #include <windows.h> -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ typedef struct _GRealTimer GRealTimer; struct _GRealTimer { -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 DWORD start; DWORD end; -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ struct timeval start; struct timeval end; -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ guint active : 1; }; @@ -67,11 +67,11 @@ g_timer_new (void) timer = g_new (GRealTimer, 1); timer->active = TRUE; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 timer->start = GetTickCount (); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ gettimeofday (&timer->start, NULL); -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ return ((GTimer*) timer); } @@ -94,11 +94,11 @@ g_timer_start (GTimer *timer) rtimer = (GRealTimer*) timer; rtimer->active = TRUE; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 rtimer->start = GetTickCount (); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ gettimeofday (&rtimer->start, NULL); -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ } void @@ -111,11 +111,11 @@ g_timer_stop (GTimer *timer) rtimer = (GRealTimer*) timer; rtimer->active = FALSE; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 rtimer->end = GetTickCount (); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ gettimeofday (&rtimer->end, NULL); -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ } void @@ -127,11 +127,11 @@ g_timer_reset (GTimer *timer) rtimer = (GRealTimer*) timer; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 rtimer->start = GetTickCount (); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ gettimeofday (&rtimer->start, NULL); -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ } gdouble @@ -140,15 +140,15 @@ g_timer_elapsed (GTimer *timer, { GRealTimer *rtimer; gdouble total; -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 struct timeval elapsed; -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ g_return_val_if_fail (timer != NULL, 0); rtimer = (GRealTimer*) timer; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (rtimer->active) rtimer->end = GetTickCount (); @@ -170,7 +170,7 @@ g_timer_elapsed (GTimer *timer, *microseconds = ((rtimer->end - rtimer->start) % 1000) * 1000; } -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ if (rtimer->active) gettimeofday (&rtimer->end, NULL); @@ -187,7 +187,7 @@ g_timer_elapsed (GTimer *timer, if (microseconds) *microseconds = elapsed.tv_usec; -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ return total; } @@ -195,7 +195,7 @@ g_timer_elapsed (GTimer *timer, void g_usleep (gulong microseconds) { -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 Sleep (microseconds / 1000); #else struct timeval tv; diff --git a/glib/gutils.c b/glib/gutils.c index 5e558e466..02718d59a 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -50,7 +50,7 @@ #include <sys/param.h> #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT /* Strict typing, please */ # include <windows.h> # include <direct.h> @@ -59,7 +59,7 @@ # ifdef _MSC_VER # include <io.h> # endif /* _MSC_VER */ -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ /* implement Glib's inline functions */ @@ -268,10 +268,10 @@ g_basename (const gchar *file_name) if (base) return base + 1; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (isalpha (file_name[0]) && file_name[1] == ':') return (gchar*) file_name + 2; -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ return (gchar*) file_name; } @@ -284,7 +284,7 @@ g_path_is_absolute (const gchar *file_name) if (file_name[0] == G_DIR_SEPARATOR) return TRUE; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (isalpha (file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR) return TRUE; #endif @@ -300,7 +300,7 @@ g_path_skip_root (gchar *file_name) if (file_name[0] == G_DIR_SEPARATOR) return file_name + 1; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (isalpha (file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR) return file_name + 3; #endif @@ -366,7 +366,7 @@ g_get_current_dir (void) gchar* g_getenv (const gchar *variable) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 g_return_val_if_fail (variable != NULL, NULL); return getenv (variable); @@ -439,23 +439,23 @@ g_get_any_init (void) if (!g_tmp_dir) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 g_tmp_dir = g_strdup ("/tmp"); -#else /* NATIVE_WIN32 */ +#else /* G_OS_WIN32 */ g_tmp_dir = g_strdup ("C:\\"); -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ } if (!g_home_dir) g_home_dir = g_strdup (g_getenv ("HOME")); -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (!g_home_dir) { /* The official way to specify a home directory on NT is * the HOMEDRIVE and HOMEPATH environment variables. * - * This is inside #ifdef NATIVE_WIN32 because with the cygwin dll, + * This is inside #ifdef G_OS_WIN32 because with the cygwin dll, * HOME should be a POSIX style pathname. */ @@ -471,7 +471,7 @@ g_get_any_init (void) g_free (homepath); } } -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ #ifdef HAVE_PWD_H { @@ -555,7 +555,7 @@ g_get_any_init (void) #else /* !HAVE_PWD_H */ -# ifdef NATIVE_WIN32 +# ifdef G_OS_WIN32 { guint len = 17; gchar buffer[17]; @@ -566,7 +566,7 @@ g_get_any_init (void) g_real_name = g_strdup (buffer); } } -# endif /* NATIVE_WIN32 */ +# endif /* G_OS_WIN32 */ #endif /* !HAVE_PWD_H */ @@ -704,7 +704,7 @@ g_int_hash (gconstpointer v) return *(const gint*) v; } -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 int gwin_ftruncate (gint fd, @@ -866,4 +866,4 @@ gwin_closedir (DIR *dir) return 0; } -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ diff --git a/glibconfig.h.win32.in b/glibconfig.h.win32.in index a9bf191e8..e87aae479 100644 --- a/glibconfig.h.win32.in +++ b/glibconfig.h.win32.in @@ -101,6 +101,8 @@ typedef unsigned long long guint64; #define GLIB_MINOR_VERSION @GLIB_MINOR_VERSION@ #define GLIB_MICRO_VERSION @GLIB_MICRO_VERSION@ +#define G_OS_WIN32 + #ifdef __cplusplus #define G_HAVE_INLINE 1 #else /* !__cplusplus */ @@ -54,14 +54,14 @@ #endif /* HAVE_UNISTD_H */ #include <errno.h> -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 #define STRICT #include <windows.h> -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ -#ifdef GLIB_NATIVE_BEOS +#ifdef G_OS_BEOS #include <net/socket.h> -#endif /* GLIB_NATIVE_BEOS */ +#endif /* G_OS_BEOS */ /* Types */ @@ -168,13 +168,13 @@ static GMemChunk *poll_chunk; static guint n_poll_records = 0; #ifdef G_THREADS_ENABLED -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 /* this pipe is used to wake up the main loop when a source is added. */ static gint wake_up_pipe[2] = { -1, -1 }; -#else /* NATIVE_WIN32 */ +#else /* G_OS_WIN32 */ static HANDLE wake_up_semaphore = NULL; -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ static GPollFD wake_up_rec; static gboolean poll_waiting = FALSE; @@ -189,7 +189,7 @@ extern gint poll (GPollFD *ufds, guint nfsd, gint timeout); # endif /* !sun */ static GPollFunc poll_func = (GPollFunc) poll; #else /* !HAVE_POLL */ -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 static gint g_poll (GPollFD *fds, guint nfds, gint timeout) @@ -327,7 +327,7 @@ g_poll (GPollFD *fds, guint nfds, gint timeout) return 1; } -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ /* The following implementation of poll() comes from the GNU C Library. * Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. @@ -339,9 +339,9 @@ g_poll (GPollFD *fds, guint nfds, gint timeout) #include <sys/select.h> #endif /* HAVE_SYS_SELECT_H */ -#ifdef GLIB_NATIVE_BEOS +#ifdef G_OS_BEOS #undef NO_FD_SET -#endif /* GLIB_NATIVE_BEOS */ +#endif /* G_OS_BEOS */ #ifndef NO_FD_SET # define SELECT_MASK fd_set @@ -407,7 +407,7 @@ g_poll (GPollFD *fds, return ready; } -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ static GPollFunc poll_func = g_poll; #endif /* !HAVE_POLL */ @@ -591,7 +591,7 @@ g_source_remove_by_funcs_user_data (GSourceFuncs *funcs, void g_get_current_time (GTimeVal *result) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 struct timeval r; g_return_if_fail (result != NULL); @@ -974,7 +974,7 @@ g_main_poll (gint timeout, gint npoll; #ifdef G_THREADS_ENABLED -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 if (wake_up_pipe[0] < 0) { if (pipe (wake_up_pipe) < 0) @@ -1074,7 +1074,7 @@ g_main_poll (gint timeout, #ifdef G_THREADS_ENABLED if (!poll_waiting) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 gchar c; read (wake_up_pipe[0], &c, 1); #endif @@ -1222,7 +1222,7 @@ g_main_wakeup (void) if (poll_waiting) { poll_waiting = FALSE; -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 write (wake_up_pipe[1], "A", 1); #else ReleaseSemaphore (wake_up_semaphore, 1, NULL); diff --git a/gmessages.c b/gmessages.c index 786f76808..4179f73f9 100644 --- a/gmessages.c +++ b/gmessages.c @@ -42,7 +42,7 @@ #endif #include <signal.h> -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT # include <windows.h> # include <process.h> /* For _getpid() */ @@ -424,7 +424,7 @@ g_log_default_handler (const gchar *log_domain, const gchar *message, gpointer unused_data) { -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 FILE *fd; #else gint fd; @@ -450,7 +450,7 @@ g_log_default_handler (const gchar *log_domain, else sprintf (prg_pid, " (pid:%u): ", getpid ()); -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 /* Use just stdout as stderr is hard to get redirected from the * DOS prompt. */ diff --git a/gmodule/ChangeLog b/gmodule/ChangeLog index 7a4232668..003914627 100644 --- a/gmodule/ChangeLog +++ b/gmodule/ChangeLog @@ -1,3 +1,8 @@ +Sun Oct 3 19:30:52 PDT 1999 Manish Singh <yosh@gimp.org> + + * gmodule.h + * testgmodule.c: use G_OS stuff + Sat Jul 24 20:47:18 1999 Tim Janik <timj@gtk.org> * merged changes from GLib-1-2 branch. diff --git a/gmodule/gmodule.h b/gmodule/gmodule.h index 908575c13..f4914013a 100644 --- a/gmodule/gmodule.h +++ b/gmodule/gmodule.h @@ -40,11 +40,11 @@ extern const char *g_log_domain_gmodule; * to feature Windows dll stubs. */ #define G_MODULE_IMPORT extern -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define G_MODULE_EXPORT __declspec(dllexport) -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ # define G_MODULE_EXPORT -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ typedef enum { diff --git a/gmodule/testgmodule.c b/gmodule/testgmodule.c index cb40da129..42c28e6ed 100644 --- a/gmodule/testgmodule.c +++ b/gmodule/testgmodule.c @@ -52,13 +52,13 @@ main (int arg, string = g_get_current_dir (); g_print ("testgmodule (%s):\n", string); -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 plugin_a = g_strconcat (string, "\\libgplugin_a.dll", NULL); plugin_b = g_strconcat (string, "\\libgplugin_b.dll", NULL); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.so", NULL); plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.so", NULL); -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ g_free (string); /* module handles diff --git a/gscanner.c b/gscanner.c index 7d106e4a5..fdbdbf278 100644 --- a/gscanner.c +++ b/gscanner.c @@ -48,7 +48,7 @@ #include <errno.h> #include <sys/types.h> /* needed for sys/stat.h */ #include <sys/stat.h> -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 #include <io.h> /* For _read() */ #endif diff --git a/gstrfuncs.c b/gstrfuncs.c index e8cc1bae2..c8bf80f51 100644 --- a/gstrfuncs.c +++ b/gstrfuncs.c @@ -669,12 +669,12 @@ g_strsignal (gint signum) char *msg; #ifdef HAVE_STRSIGNAL -#ifdef GLIB_NATIVE_BEOS +#ifdef G_OS_BEOS extern const char * strsignal(int); -#else /* !GLIB_NATIVE_BEOS */ +#else /* !G_OS_BEOS */ /* this is declared differently (const) in string.h on BeOS */ extern char *strsignal (int sig); -#endif /* !GLIB_NATIVE_BEOS */ +#endif /* !G_OS_BEOS */ return strsignal (signum); #elif NO_SYS_SIGLIST switch (signum) @@ -66,7 +66,7 @@ static void g_thread_fail (void); gboolean g_thread_use_default_impl = TRUE; gboolean g_threads_got_initialized = FALSE; -#if defined(NATIVE_WIN32) && defined(__GNUC__) +#if defined(G_OS_WIN32) && defined(__GNUC__) __declspec(dllexport) #endif GThreadFunctions g_thread_functions_for_glib_use = { diff --git a/gthread/gthread-impl.c b/gthread/gthread-impl.c index 726da3931..f353c4608 100644 --- a/gthread/gthread-impl.c +++ b/gthread/gthread-impl.c @@ -67,7 +67,7 @@ g_thread_init (GThreadFunctions* init) else g_thread_use_default_impl = FALSE; -#if defined (WIN32) && defined (__GNUC__) +#if defined (G_OS_WIN32) && defined (__GNUC__) memcpy(&g_thread_functions_for_glib_use, init, sizeof (*init)); #else g_thread_functions_for_glib_use = *init; @@ -36,25 +36,25 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif /* HAVE_UNISTD_H */ -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 #include <sys/time.h> -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 #include <windows.h> -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ typedef struct _GRealTimer GRealTimer; struct _GRealTimer { -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 DWORD start; DWORD end; -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ struct timeval start; struct timeval end; -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ guint active : 1; }; @@ -67,11 +67,11 @@ g_timer_new (void) timer = g_new (GRealTimer, 1); timer->active = TRUE; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 timer->start = GetTickCount (); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ gettimeofday (&timer->start, NULL); -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ return ((GTimer*) timer); } @@ -94,11 +94,11 @@ g_timer_start (GTimer *timer) rtimer = (GRealTimer*) timer; rtimer->active = TRUE; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 rtimer->start = GetTickCount (); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ gettimeofday (&rtimer->start, NULL); -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ } void @@ -111,11 +111,11 @@ g_timer_stop (GTimer *timer) rtimer = (GRealTimer*) timer; rtimer->active = FALSE; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 rtimer->end = GetTickCount (); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ gettimeofday (&rtimer->end, NULL); -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ } void @@ -127,11 +127,11 @@ g_timer_reset (GTimer *timer) rtimer = (GRealTimer*) timer; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 rtimer->start = GetTickCount (); -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ gettimeofday (&rtimer->start, NULL); -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ } gdouble @@ -140,15 +140,15 @@ g_timer_elapsed (GTimer *timer, { GRealTimer *rtimer; gdouble total; -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 struct timeval elapsed; -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ g_return_val_if_fail (timer != NULL, 0); rtimer = (GRealTimer*) timer; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (rtimer->active) rtimer->end = GetTickCount (); @@ -170,7 +170,7 @@ g_timer_elapsed (GTimer *timer, *microseconds = ((rtimer->end - rtimer->start) % 1000) * 1000; } -#else /* !NATIVE_WIN32 */ +#else /* !G_OS_WIN32 */ if (rtimer->active) gettimeofday (&rtimer->end, NULL); @@ -187,7 +187,7 @@ g_timer_elapsed (GTimer *timer, if (microseconds) *microseconds = elapsed.tv_usec; -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ return total; } @@ -195,7 +195,7 @@ g_timer_elapsed (GTimer *timer, void g_usleep (gulong microseconds) { -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 Sleep (microseconds / 1000); #else struct timeval tv; @@ -50,7 +50,7 @@ #include <sys/param.h> #endif -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 # define STRICT /* Strict typing, please */ # include <windows.h> # include <direct.h> @@ -59,7 +59,7 @@ # ifdef _MSC_VER # include <io.h> # endif /* _MSC_VER */ -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ /* implement Glib's inline functions */ @@ -268,10 +268,10 @@ g_basename (const gchar *file_name) if (base) return base + 1; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (isalpha (file_name[0]) && file_name[1] == ':') return (gchar*) file_name + 2; -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ return (gchar*) file_name; } @@ -284,7 +284,7 @@ g_path_is_absolute (const gchar *file_name) if (file_name[0] == G_DIR_SEPARATOR) return TRUE; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (isalpha (file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR) return TRUE; #endif @@ -300,7 +300,7 @@ g_path_skip_root (gchar *file_name) if (file_name[0] == G_DIR_SEPARATOR) return file_name + 1; -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (isalpha (file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR) return file_name + 3; #endif @@ -366,7 +366,7 @@ g_get_current_dir (void) gchar* g_getenv (const gchar *variable) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 g_return_val_if_fail (variable != NULL, NULL); return getenv (variable); @@ -439,23 +439,23 @@ g_get_any_init (void) if (!g_tmp_dir) { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 g_tmp_dir = g_strdup ("/tmp"); -#else /* NATIVE_WIN32 */ +#else /* G_OS_WIN32 */ g_tmp_dir = g_strdup ("C:\\"); -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ } if (!g_home_dir) g_home_dir = g_strdup (g_getenv ("HOME")); -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 if (!g_home_dir) { /* The official way to specify a home directory on NT is * the HOMEDRIVE and HOMEPATH environment variables. * - * This is inside #ifdef NATIVE_WIN32 because with the cygwin dll, + * This is inside #ifdef G_OS_WIN32 because with the cygwin dll, * HOME should be a POSIX style pathname. */ @@ -471,7 +471,7 @@ g_get_any_init (void) g_free (homepath); } } -#endif /* !NATIVE_WIN32 */ +#endif /* !G_OS_WIN32 */ #ifdef HAVE_PWD_H { @@ -555,7 +555,7 @@ g_get_any_init (void) #else /* !HAVE_PWD_H */ -# ifdef NATIVE_WIN32 +# ifdef G_OS_WIN32 { guint len = 17; gchar buffer[17]; @@ -566,7 +566,7 @@ g_get_any_init (void) g_real_name = g_strdup (buffer); } } -# endif /* NATIVE_WIN32 */ +# endif /* G_OS_WIN32 */ #endif /* !HAVE_PWD_H */ @@ -704,7 +704,7 @@ g_int_hash (gconstpointer v) return *(const gint*) v; } -#ifdef NATIVE_WIN32 +#ifdef G_OS_WIN32 int gwin_ftruncate (gint fd, @@ -866,4 +866,4 @@ gwin_closedir (DIR *dir) return 0; } -#endif /* NATIVE_WIN32 */ +#endif /* G_OS_WIN32 */ diff --git a/testglib.c b/testglib.c index 54d621406..2a5ba7381 100644 --- a/testglib.c +++ b/testglib.c @@ -306,7 +306,7 @@ main (int argc, gchar *filename; gchar *dirname; } dirname_checks[] = { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 { "/", "/" }, { "////", "/" }, { ".////", "." }, @@ -699,7 +699,7 @@ main (int argc, for (i = 0; i < 10000; i++) g_string_append_c (string1, 'a'+(i%26)); -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 /* MSVC, mingw32 and LCC use the same run-time C library, which doesn't like the %10000.10000f format... */ g_string_sprintf (string2, "%s|%0100d|%s|%s|%0*d|%*.*f|%10000.10000f", diff --git a/tests/testglib.c b/tests/testglib.c index 54d621406..2a5ba7381 100644 --- a/tests/testglib.c +++ b/tests/testglib.c @@ -306,7 +306,7 @@ main (int argc, gchar *filename; gchar *dirname; } dirname_checks[] = { -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 { "/", "/" }, { "////", "/" }, { ".////", "." }, @@ -699,7 +699,7 @@ main (int argc, for (i = 0; i < 10000; i++) g_string_append_c (string1, 'a'+(i%26)); -#ifndef NATIVE_WIN32 +#ifndef G_OS_WIN32 /* MSVC, mingw32 and LCC use the same run-time C library, which doesn't like the %10000.10000f format... */ g_string_sprintf (string2, "%s|%0100d|%s|%s|%0*d|%*.*f|%10000.10000f", |