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
This commit is contained in:
Manish Singh 1999-10-04 02:32:50 +00:00
parent 4944d4df46
commit 7ea73a0199
37 changed files with 344 additions and 206 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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([

View File

@ -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];

View File

@ -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];

18
glib.h
View File

@ -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

View File

@ -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];

View File

@ -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];

View File

@ -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

View File

@ -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);

View File

@ -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.
*/

View File

@ -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

View File

@ -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)

View File

@ -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 = {

View File

@ -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;

View File

@ -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 */

View File

@ -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 */

32
gmain.c
View File

@ -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);

View File

@ -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.
*/

View File

@ -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.

View File

@ -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
{

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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 = {

View File

@ -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;

View File

@ -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;

View File

@ -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 */

View File

@ -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",

View File

@ -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",