Mail Archives: djgpp-workers/2000/07/18/07:16:20
Here the first quick try how it would look like. I don't think
about getting this patch into CVS now - I haven't debuged it yet,
also DJGPP patches should go into GCC first.
So the patch is only for review.
Laurynas
Index: include/glob.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/glob.h,v
retrieving revision 1.1
diff -u -r1.1 glob.h
--- glob.h 1995/03/21 09:01:00 1.1
+++ glob.h 2000/07/18 11:11:33
@@ -10,11 +10,19 @@
#ifndef __STRICT_ANSI__
-#include <sys/djtypes.h>
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
+
+#else
+
+#define __need_size_t
+#include <stddef.h>
+
+#endif
typedef struct {
size_t gl_pathc;
Index: include/go32.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/go32.h,v
retrieving revision 1.2
diff -u -r1.2 go32.h
--- go32.h 1998/11/15 14:14:42 1.2
+++ go32.h 2000/07/18 11:11:34
@@ -14,11 +14,20 @@
#ifndef _POSIX_SOURCE
#include <sys/version.h>
-#include <sys/djtypes.h>
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
+
+#else
+
+#define __need_size_t
+#include <stddef.h>
+
+#endif
typedef struct {
unsigned long size_of_this_structure_in_bytes;
Index: include/locale.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/locale.h,v
retrieving revision 1.2
diff -u -r1.2 locale.h
--- locale.h 1997/08/31 16:43:14 1.2
+++ locale.h 2000/07/18 11:11:35
@@ -15,7 +15,18 @@
#define LC_MONETARY 0x04
#define LC_NUMERIC 0x08
#define LC_TIME 0x10
+
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+
+#undef NULL
#define NULL 0
+
+#else
+
+#define __need_NULL
+#include <stddef.h>
+
+#endif
struct lconv {
char *currency_symbol;
Index: include/stdio.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/stdio.h,v
retrieving revision 1.2
diff -u -r1.2 stdio.h
--- stdio.h 1998/11/15 13:37:28 1.2
+++ stdio.h 2000/07/18 11:11:36
@@ -17,15 +17,11 @@
#define _IONBF 00002
#define _IOLBF 00004
-/* Some programs think they know better... */
-#undef NULL
-
#define BUFSIZ 16384
#define EOF (-1)
#define FILENAME_MAX 260
#define FOPEN_MAX 20
#define L_tmpnam 260
-#define NULL 0
#define TMP_MAX 999999
#define SEEK_SET 0
@@ -35,9 +31,23 @@
__DJ_va_list
#undef __DJ_va_list
#define __DJ_va_list
+
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+
+#undef NULL
+#define NULL 0
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
+
+#else
+
+#define __need_NULL
+#define __need_size_t
+#include <stddef.h>
+
+#endif
/* Note that the definitions of these fields are NOT guaranteed! They
may change with any release without notice! The fact that they
Index: include/stdlib.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/stdlib.h,v
retrieving revision 1.5
diff -u -r1.5 stdlib.h
--- stdlib.h 1999/06/03 17:22:28 1.5
+++ stdlib.h 2000/07/18 11:11:37
@@ -12,13 +12,9 @@
#include <sys/djtypes.h>
-/* Some programs think they know better... */
-#undef NULL
-
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#define MB_CUR_MAX __dj_mb_cur_max
-#define NULL 0
#define RAND_MAX 2147483647
extern int __dj_mb_cur_max;
@@ -33,9 +29,23 @@
long rem;
} ldiv_t;
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+
+#undef NULL
+#define NULL 0
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
+
+#else
+
+#define __need_NULL
+#define __need_size_t
+#include <stddef.h>
+
+#endif
+
__DJ_wchar_t
#undef __DJ_wchar_t
#define __DJ_wchar_t
Index: include/string.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/string.h,v
retrieving revision 1.3
diff -u -r1.3 string.h
--- string.h 2000/05/13 02:04:35 1.3
+++ string.h 2000/07/18 11:11:37
@@ -10,15 +10,22 @@
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
-#include <sys/djtypes.h>
-
-/* Some programs think they know better... */
-#undef NULL
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+#undef NULL
#define NULL 0
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
+
+#else
+
+#define __need_NULL
+#define __need_size_t
+#include <stddef.h>
+
+#endif
void * memchr(const void *_s, int _c, size_t _n);
int memcmp(const void *_s1, const void *_s2, size_t _n);
Index: include/time.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/time.h,v
retrieving revision 1.4
diff -u -r1.4 time.h
--- time.h 1999/06/03 17:22:28 1.4
+++ time.h 2000/07/18 11:11:37
@@ -17,16 +17,27 @@
#include <sys/djtypes.h>
-/* Some programs think they know better... */
-#undef NULL
-
-#define NULL 0
__DJ_clock_t
#undef __DJ_clock_t
#define __DJ_clock_t
+
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+
+#undef NULL
+#define NULL 0
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
+
+#else
+
+#define __need_NULL
+#define __need_size_t
+#include <stddef.h>
+
+#endif
+
__DJ_time_t
#undef __DJ_time_t
#define __DJ_time_t
Index: include/unistd.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/unistd.h,v
retrieving revision 1.6
diff -u -r1.6 unistd.h
--- unistd.h 2000/06/19 18:00:55 1.6
+++ unistd.h 2000/07/18 11:11:38
@@ -1,3 +1,4 @@
+/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
@@ -19,11 +20,6 @@
#define SEEK_CUR 1
#define SEEK_END 2
-/* Some programs think they know better... */
-#undef NULL
-
-#define NULL 0
-
#define F_OK 0x01
#define R_OK 0x02
#define W_OK 0x04
@@ -61,6 +57,12 @@
#define _SC_TZNAME_MAX 9
#define _SC_VERSION 10
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+
+#undef NULL
+#define NULL 0
+
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
@@ -68,6 +70,15 @@
#undef __DJ_ssize_t
#define __DJ_ssize_t
+#else
+
+/* This will pull ssize_t too. */
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#endif
+
extern char *optarg;
extern int optind, opterr, optopt;
Index: include/sys/djtypes.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/sys/djtypes.h,v
retrieving revision 1.6
diff -u -r1.6 djtypes.h
--- djtypes.h 2000/06/19 18:00:55 1.6
+++ djtypes.h 2000/07/18 11:11:39
@@ -10,18 +10,15 @@
#define __DJ_off_t typedef int off_t;
#define __DJ_offset_t typedef long long offset_t;
#define __DJ_pid_t typedef int pid_t;
-#define __DJ_size_t typedef long unsigned int size_t;
-#define __DJ_ssize_t typedef int ssize_t;
#define __DJ_time_t typedef unsigned int time_t;
#define __DJ_uid_t typedef int uid_t;
-/* Under GCC 2.96 or later, we use its builtin va_list management. */
-#if ((__GNUC_ == 2) && (__GNUC_MINOR__ >= 96)) || (__GNUC__ >= 3)
-#define __DJ_va_list typedef __builtin_va_list va_list
-#else
-#define __DJ_va_list typedef void *va_list;
-#endif
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+#define __DJ_size_t typedef long unsigned int size_t;
+#define __DJ_wint_t typedef int wint_t;
+#define __DJ_ssize_t typedef int ssize_t;
+
#if defined(__cplusplus) && ( (__GNUC_MINOR__ >= 8 && __GNUC__ == 2 ) || __GNUC__ >= 3 )
/* wchar_t is now a keyword in C++ */
#define __DJ_wchar_t
@@ -30,6 +27,6 @@
#define __DJ_wchar_t typedef unsigned short wchar_t;
#endif
-#define __DJ_wint_t typedef int wint_t;
+#endif /* #if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1) */
#endif
Index: include/sys/movedata.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/sys/movedata.h,v
retrieving revision 1.2
diff -u -r1.2 movedata.h
--- movedata.h 1998/01/01 23:38:48 1.2
+++ movedata.h 2000/07/18 11:11:39
@@ -13,11 +13,19 @@
#ifndef _POSIX_SOURCE
-#include <sys/djtypes.h>
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
+
+#else
+
+#define __need_size_t
+#include <stddef.h>
+
+#endif
/* This header is intended to be included only by other
headers, like <go32.h> and <string.h>. You may
Index: include/sys/types.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/sys/types.h,v
retrieving revision 1.5
diff -u -r1.5 types.h
--- types.h 2000/06/19 18:00:55 1.5
+++ types.h 2000/07/18 11:11:39
@@ -31,12 +31,20 @@
__DJ_pid_t
#undef __DJ_pid_t
#define __DJ_pid_t
+#if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 95)) || (__GNUC__ == 1)
+
+#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
-__DJ_ssize_t
-#undef __DJ_ssize_t
-#define __DJ_ssize_t
+
+#else
+
+/* This will also pull ssize_t */
+#define __need_size_t
+#include <stddef.h>
+
+#endif
__DJ_uid_t
#undef __DJ_uid_t
#define __DJ_uid_t
- Raw text -