From 374c870b96f8d7aff25e0c7ec43efba5a42f06ee Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 5 Oct 1999 16:05:38 +0000 Subject: [PATCH] Drop the mapping of POSIX function names to the underscored versions, it's * glib.h: (Win32) Drop the mapping of POSIX function names to the underscored versions, it's unnecessary after all. With MSVC we get them from oldnames.lib, with gcc-2.95 and mingw32 from -lmoldname-msvc. Add comment about what headers to include for prototypes. --- ChangeLog | 8 +++++++- ChangeLog.pre-2-0 | 8 +++++++- ChangeLog.pre-2-10 | 8 +++++++- ChangeLog.pre-2-12 | 8 +++++++- ChangeLog.pre-2-2 | 8 +++++++- ChangeLog.pre-2-4 | 8 +++++++- ChangeLog.pre-2-6 | 8 +++++++- ChangeLog.pre-2-8 | 8 +++++++- glib.h | 48 +++++++++++++++++----------------------------- glib/glib.h | 48 +++++++++++++++++----------------------------- 10 files changed, 92 insertions(+), 68 deletions(-) diff --git a/ChangeLog b/ChangeLog index f34491be1..2570d2c34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,14 @@ 1999-10-05 Tor Lillqvist + * glib.h: (Win32) Drop the mapping of POSIX function names to the + underscored versions, it's unnecessary after all. With MSVC we get + them from oldnames.lib, with gcc-2.95 and mingw32 from + -lmoldname-msvc. Add comment about what headers to include for + prototypes. + * glibconfig.h.win32.in: Don't define WIN32 and NATIVE_WIN32. - * gerror.c (g_on_error_query): (Win32) Slightly more verbosity. + * gerror.c (g_on_error_query): (Win32) Slightly increased verbosity. * build-dll: Don't strip. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index f34491be1..2570d2c34 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,8 +1,14 @@ 1999-10-05 Tor Lillqvist + * glib.h: (Win32) Drop the mapping of POSIX function names to the + underscored versions, it's unnecessary after all. With MSVC we get + them from oldnames.lib, with gcc-2.95 and mingw32 from + -lmoldname-msvc. Add comment about what headers to include for + prototypes. + * glibconfig.h.win32.in: Don't define WIN32 and NATIVE_WIN32. - * gerror.c (g_on_error_query): (Win32) Slightly more verbosity. + * gerror.c (g_on_error_query): (Win32) Slightly increased verbosity. * build-dll: Don't strip. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f34491be1..2570d2c34 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,8 +1,14 @@ 1999-10-05 Tor Lillqvist + * glib.h: (Win32) Drop the mapping of POSIX function names to the + underscored versions, it's unnecessary after all. With MSVC we get + them from oldnames.lib, with gcc-2.95 and mingw32 from + -lmoldname-msvc. Add comment about what headers to include for + prototypes. + * glibconfig.h.win32.in: Don't define WIN32 and NATIVE_WIN32. - * gerror.c (g_on_error_query): (Win32) Slightly more verbosity. + * gerror.c (g_on_error_query): (Win32) Slightly increased verbosity. * build-dll: Don't strip. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index f34491be1..2570d2c34 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,8 +1,14 @@ 1999-10-05 Tor Lillqvist + * glib.h: (Win32) Drop the mapping of POSIX function names to the + underscored versions, it's unnecessary after all. With MSVC we get + them from oldnames.lib, with gcc-2.95 and mingw32 from + -lmoldname-msvc. Add comment about what headers to include for + prototypes. + * glibconfig.h.win32.in: Don't define WIN32 and NATIVE_WIN32. - * gerror.c (g_on_error_query): (Win32) Slightly more verbosity. + * gerror.c (g_on_error_query): (Win32) Slightly increased verbosity. * build-dll: Don't strip. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f34491be1..2570d2c34 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,8 +1,14 @@ 1999-10-05 Tor Lillqvist + * glib.h: (Win32) Drop the mapping of POSIX function names to the + underscored versions, it's unnecessary after all. With MSVC we get + them from oldnames.lib, with gcc-2.95 and mingw32 from + -lmoldname-msvc. Add comment about what headers to include for + prototypes. + * glibconfig.h.win32.in: Don't define WIN32 and NATIVE_WIN32. - * gerror.c (g_on_error_query): (Win32) Slightly more verbosity. + * gerror.c (g_on_error_query): (Win32) Slightly increased verbosity. * build-dll: Don't strip. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f34491be1..2570d2c34 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,8 +1,14 @@ 1999-10-05 Tor Lillqvist + * glib.h: (Win32) Drop the mapping of POSIX function names to the + underscored versions, it's unnecessary after all. With MSVC we get + them from oldnames.lib, with gcc-2.95 and mingw32 from + -lmoldname-msvc. Add comment about what headers to include for + prototypes. + * glibconfig.h.win32.in: Don't define WIN32 and NATIVE_WIN32. - * gerror.c (g_on_error_query): (Win32) Slightly more verbosity. + * gerror.c (g_on_error_query): (Win32) Slightly increased verbosity. * build-dll: Don't strip. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f34491be1..2570d2c34 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,8 +1,14 @@ 1999-10-05 Tor Lillqvist + * glib.h: (Win32) Drop the mapping of POSIX function names to the + underscored versions, it's unnecessary after all. With MSVC we get + them from oldnames.lib, with gcc-2.95 and mingw32 from + -lmoldname-msvc. Add comment about what headers to include for + prototypes. + * glibconfig.h.win32.in: Don't define WIN32 and NATIVE_WIN32. - * gerror.c (g_on_error_query): (Win32) Slightly more verbosity. + * gerror.c (g_on_error_query): (Win32) Slightly increased verbosity. * build-dll: Don't strip. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f34491be1..2570d2c34 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,8 +1,14 @@ 1999-10-05 Tor Lillqvist + * glib.h: (Win32) Drop the mapping of POSIX function names to the + underscored versions, it's unnecessary after all. With MSVC we get + them from oldnames.lib, with gcc-2.95 and mingw32 from + -lmoldname-msvc. Add comment about what headers to include for + prototypes. + * glibconfig.h.win32.in: Don't define WIN32 and NATIVE_WIN32. - * gerror.c (g_on_error_query): (Win32) Slightly more verbosity. + * gerror.c (g_on_error_query): (Win32) Slightly increased verbosity. * build-dll: Don't strip. diff --git a/glib.h b/glib.h index dba5629c7..4300fd3e0 100644 --- a/glib.h +++ b/glib.h @@ -2757,44 +2757,32 @@ GIOChannel *g_io_channel_win32_new_stream_socket (int socket); typedef int pid_t; #endif -/* These POSIXish functions are available in the Microsoft C library - * prefixed with underscore (which of course technically speaking is - * the Right Thing, as they are non-ANSI. Not that being non-ANSI - * prevents Microsoft from practically requiring you to include - * every now and then...). +/* + * To get prototypes for the following POSIXish functions, you have to + * include the indicated non-POSIX headers. The functions are defined + * in OLDNAMES.LIB (MSVC) or -lmoldname-msvc (mingw32). * - * You still need to include the appropriate headers to get the - * prototypes, like , , or . - * - * For some functions, we provide emulators in glib, which are prefixed - * with gwin_. + * getcwd: (MSVC), (mingw32) + * getpid: + * access: + * unlink: or + * open, read, write, lseek, close: + * rmdir: + * pipe: */ + +/* pipe is not in OLDNAMES.LIB or -lmoldname-msvc. */ +#define pipe(phandles) _pipe (phandles, 4096, _O_BINARY) + +/* For some POSIX functions that are not provided by the MS runtime, + * we provide emulators in glib, which are prefixed with gwin_. */ -# define getcwd _getcwd -# define getpid _getpid -# define access _access -#ifdef __GNUC__ -# define stat _stat -# define fileno _fileno -#endif -# define fstat _fstat -# define unlink _unlink -# define open _open -# define read _read -# define write _write -# define lseek _lseek -# define close _close -# define rmdir _rmdir -# define pipe(phandles) _pipe (phandles, 4096, _O_BINARY) -# define popen _popen -# define pclose _pclose -# define fdopen _fdopen -# define hypot _hypot # define ftruncate(fd, size) gwin_ftruncate (fd, size) # define opendir gwin_opendir # define readdir gwin_readdir # define rewinddir gwin_rewinddir # define closedir gwin_closedir # define NAME_MAX 255 + struct DIR { gchar *dir_name; diff --git a/glib/glib.h b/glib/glib.h index dba5629c7..4300fd3e0 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -2757,44 +2757,32 @@ GIOChannel *g_io_channel_win32_new_stream_socket (int socket); typedef int pid_t; #endif -/* These POSIXish functions are available in the Microsoft C library - * prefixed with underscore (which of course technically speaking is - * the Right Thing, as they are non-ANSI. Not that being non-ANSI - * prevents Microsoft from practically requiring you to include - * every now and then...). +/* + * To get prototypes for the following POSIXish functions, you have to + * include the indicated non-POSIX headers. The functions are defined + * in OLDNAMES.LIB (MSVC) or -lmoldname-msvc (mingw32). * - * You still need to include the appropriate headers to get the - * prototypes, like , , or . - * - * For some functions, we provide emulators in glib, which are prefixed - * with gwin_. + * getcwd: (MSVC), (mingw32) + * getpid: + * access: + * unlink: or + * open, read, write, lseek, close: + * rmdir: + * pipe: */ + +/* pipe is not in OLDNAMES.LIB or -lmoldname-msvc. */ +#define pipe(phandles) _pipe (phandles, 4096, _O_BINARY) + +/* For some POSIX functions that are not provided by the MS runtime, + * we provide emulators in glib, which are prefixed with gwin_. */ -# define getcwd _getcwd -# define getpid _getpid -# define access _access -#ifdef __GNUC__ -# define stat _stat -# define fileno _fileno -#endif -# define fstat _fstat -# define unlink _unlink -# define open _open -# define read _read -# define write _write -# define lseek _lseek -# define close _close -# define rmdir _rmdir -# define pipe(phandles) _pipe (phandles, 4096, _O_BINARY) -# define popen _popen -# define pclose _pclose -# define fdopen _fdopen -# define hypot _hypot # define ftruncate(fd, size) gwin_ftruncate (fd, size) # define opendir gwin_opendir # define readdir gwin_readdir # define rewinddir gwin_rewinddir # define closedir gwin_closedir # define NAME_MAX 255 + struct DIR { gchar *dir_name;