+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
+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
+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
+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
+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
+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
+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
+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
#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 */
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
$glib_atexit
$glib_memmove
$glib_defines
+$glib_os
$glib_vacopy
fi
cat >>$outfile <<_______EOF
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
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([
#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() */
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";
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')
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 };
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];
#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() */
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";
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')
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 };
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];
#endif
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
/* On native Win32, directory separator is the backslash, and search path
* separator is the semicolon.
#define G_SEARCHPATH_SEPARATOR ';'
#define G_SEARCHPATH_SEPARATOR_S ";"
-#else /* !NATIVE_WIN32 */
+#else /* !G_OS_WIN32 */
/* Unix */
#define G_SEARCHPATH_SEPARATOR ':'
#define G_SEARCHPATH_SEPARATOR_S ":"
-#endif /* !NATIVE_WIN32 */
+#endif /* !G_OS_WIN32 */
#ifdef __cplusplus
extern "C" {
* 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;
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;
/* Windows emulation stubs for common Unix functions
*/
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
# define MAXPATHLEN 1024
#ifdef _MSC_VER
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
#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() */
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";
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')
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 };
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];
#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() */
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";
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')
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 };
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];
#endif
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
/* On native Win32, directory separator is the backslash, and search path
* separator is the semicolon.
#define G_SEARCHPATH_SEPARATOR ';'
#define G_SEARCHPATH_SEPARATOR_S ";"
-#else /* !NATIVE_WIN32 */
+#else /* !G_OS_WIN32 */
/* Unix */
#define G_SEARCHPATH_SEPARATOR ':'
#define G_SEARCHPATH_SEPARATOR_S ":"
-#endif /* !NATIVE_WIN32 */
+#endif /* !G_OS_WIN32 */
#ifdef __cplusplus
extern "C" {
* 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;
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;
/* Windows emulation stubs for common Unix functions
*/
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
# define MAXPATHLEN 1024
#ifdef _MSC_VER
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
#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 */
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;
# 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)
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.
#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
return ready;
}
-#endif /* !NATIVE_WIN32 */
+#endif /* !G_OS_WIN32 */
static GPollFunc poll_func = g_poll;
#endif /* !HAVE_POLL */
void
g_get_current_time (GTimeVal *result)
{
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
struct timeval r;
g_return_if_fail (result != NULL);
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)
#ifdef G_THREADS_ENABLED
if (!poll_waiting)
{
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
gchar c;
read (wake_up_pipe[0], &c, 1);
#endif
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);
#endif
#include <signal.h>
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
# define STRICT
# include <windows.h>
# include <process.h> /* For _getpid() */
const gchar *message,
gpointer unused_data)
{
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
FILE *fd;
#else
gint fd;
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.
*/
#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
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)
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 = {
#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;
};
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);
}
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
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
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
{
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 ();
*microseconds =
((rtimer->end - rtimer->start) % 1000) * 1000;
}
-#else /* !NATIVE_WIN32 */
+#else /* !G_OS_WIN32 */
if (rtimer->active)
gettimeofday (&rtimer->end, NULL);
if (microseconds)
*microseconds = elapsed.tv_usec;
-#endif /* !NATIVE_WIN32 */
+#endif /* !G_OS_WIN32 */
return total;
}
void
g_usleep (gulong microseconds)
{
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
Sleep (microseconds / 1000);
#else
struct timeval tv;
#include <sys/param.h>
#endif
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
# define STRICT /* Strict typing, please */
# include <windows.h>
# include <direct.h>
# ifdef _MSC_VER
# include <io.h>
# endif /* _MSC_VER */
-#endif /* NATIVE_WIN32 */
+#endif /* G_OS_WIN32 */
/* implement Glib's inline functions
*/
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;
}
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
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
gchar*
g_getenv (const gchar *variable)
{
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
g_return_val_if_fail (variable != NULL, NULL);
return getenv (variable);
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.
*/
g_free (homepath);
}
}
-#endif /* !NATIVE_WIN32 */
+#endif /* !G_OS_WIN32 */
#ifdef HAVE_PWD_H
{
#else /* !HAVE_PWD_H */
-# ifdef NATIVE_WIN32
+# ifdef G_OS_WIN32
{
guint len = 17;
gchar buffer[17];
g_real_name = g_strdup (buffer);
}
}
-# endif /* NATIVE_WIN32 */
+# endif /* G_OS_WIN32 */
#endif /* !HAVE_PWD_H */
return *(const gint*) v;
}
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
int
gwin_ftruncate (gint fd,
return 0;
}
-#endif /* NATIVE_WIN32 */
+#endif /* G_OS_WIN32 */
#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 */
#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 */
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;
# 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)
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.
#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
return ready;
}
-#endif /* !NATIVE_WIN32 */
+#endif /* !G_OS_WIN32 */
static GPollFunc poll_func = g_poll;
#endif /* !HAVE_POLL */
void
g_get_current_time (GTimeVal *result)
{
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
struct timeval r;
g_return_if_fail (result != NULL);
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)
#ifdef G_THREADS_ENABLED
if (!poll_waiting)
{
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
gchar c;
read (wake_up_pipe[0], &c, 1);
#endif
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);
#endif
#include <signal.h>
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
# define STRICT
# include <windows.h>
# include <process.h> /* For _getpid() */
const gchar *message,
gpointer unused_data)
{
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
FILE *fd;
#else
gint fd;
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.
*/
+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.
* 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
{
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
#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
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)
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 = {
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;
#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;
};
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);
}
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
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
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
{
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 ();
*microseconds =
((rtimer->end - rtimer->start) % 1000) * 1000;
}
-#else /* !NATIVE_WIN32 */
+#else /* !G_OS_WIN32 */
if (rtimer->active)
gettimeofday (&rtimer->end, NULL);
if (microseconds)
*microseconds = elapsed.tv_usec;
-#endif /* !NATIVE_WIN32 */
+#endif /* !G_OS_WIN32 */
return total;
}
void
g_usleep (gulong microseconds)
{
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
Sleep (microseconds / 1000);
#else
struct timeval tv;
#include <sys/param.h>
#endif
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
# define STRICT /* Strict typing, please */
# include <windows.h>
# include <direct.h>
# ifdef _MSC_VER
# include <io.h>
# endif /* _MSC_VER */
-#endif /* NATIVE_WIN32 */
+#endif /* G_OS_WIN32 */
/* implement Glib's inline functions
*/
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;
}
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
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
gchar*
g_getenv (const gchar *variable)
{
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
g_return_val_if_fail (variable != NULL, NULL);
return getenv (variable);
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.
*/
g_free (homepath);
}
}
-#endif /* !NATIVE_WIN32 */
+#endif /* !G_OS_WIN32 */
#ifdef HAVE_PWD_H
{
#else /* !HAVE_PWD_H */
-# ifdef NATIVE_WIN32
+# ifdef G_OS_WIN32
{
guint len = 17;
gchar buffer[17];
g_real_name = g_strdup (buffer);
}
}
-# endif /* NATIVE_WIN32 */
+# endif /* G_OS_WIN32 */
#endif /* !HAVE_PWD_H */
return *(const gint*) v;
}
-#ifdef NATIVE_WIN32
+#ifdef G_OS_WIN32
int
gwin_ftruncate (gint fd,
return 0;
}
-#endif /* NATIVE_WIN32 */
+#endif /* G_OS_WIN32 */
gchar *filename;
gchar *dirname;
} dirname_checks[] = {
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
{ "/", "/" },
{ "////", "/" },
{ ".////", "." },
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",
gchar *filename;
gchar *dirname;
} dirname_checks[] = {
-#ifndef NATIVE_WIN32
+#ifndef G_OS_WIN32
{ "/", "/" },
{ "////", "/" },
{ ".////", "." },
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",