Mail Archives: djgpp-workers/2003/03/04/14:52:31
Hello.
Below is patch to add C99 sections to the remaining standard headers.
This includes moving the whole of <stdarg.h> into the free-standing
part of the header, as required by the C standard. C89 required
that <stdarg.h>'s definitions be in the free-standing part of the header
(MartinS checked this), so this is a bugfix.
OK to commit?
Thanks, bye, Rich =]
Index: include/float.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/float.h,v
retrieving revision 1.1
diff -p -c -3 -r1.1 float.h
*** include/float.h 23 Aug 1995 05:02:58 -0000 1.1
--- include/float.h 4 Mar 2003 19:47:41 -0000
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_float_h_
#define __dj_include_float_h_
*************** extern long double __dj_long_double_min;
*** 50,56 ****
--- 51,67 ----
#define LDBL_MIN_10_EXP (-4931)
#define LDBL_MIN_EXP (-16381)
+ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
+ || !defined(__STRICT_ANSI__)
+
+ #endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
+
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
+
+ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
+ || !defined(__STRICT_ANSI__)
+
+ #endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
#ifndef __STRICT_ANSI__
Index: include/stdarg.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/stdarg.h,v
retrieving revision 1.8
diff -p -c -3 -r1.8 stdarg.h
*** include/stdarg.h 2 Jan 2001 17:08:26 -0000 1.8
--- include/stdarg.h 4 Mar 2003 19:47:41 -0000
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
***************
*** 9,16 ****
extern "C" {
#endif
- #ifndef __dj_ENFORCE_ANSI_FREESTANDING
-
#ifdef __dj_include_varargs_h_
#error stdarg.h and varargs.h are mutually exclusive
#endif
--- 10,15 ----
*************** __DJ_va_list
*** 46,52 ****
(ap = ((va_list) __builtin_next_arg (last_arg)))
#endif /* #if ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 96)) || (__GNUC__ >= 3) */
!
#ifndef __STRICT_ANSI__
#ifndef _POSIX_SOURCE
--- 45,63 ----
(ap = ((va_list) __builtin_next_arg (last_arg)))
#endif /* #if ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 96)) || (__GNUC__ >= 3) */
!
! #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
! || !defined(__STRICT_ANSI__)
!
! #endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
!
! #ifndef __dj_ENFORCE_ANSI_FREESTANDING
!
! #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
! || !defined(__STRICT_ANSI__)
!
! #endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
!
#ifndef __STRICT_ANSI__
#ifndef _POSIX_SOURCE
Index: include/stddef.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/stddef.h,v
retrieving revision 1.4
diff -p -c -3 -r1.4 stddef.h
*** include/stddef.h 17 Oct 2002 23:00:24 -0000 1.4
--- include/stddef.h 4 Mar 2003 19:47:45 -0000
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
*************** __DJ_wchar_t
*** 33,39 ****
--- 34,50 ----
#define _WCHAR_T
#endif
+ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
+ || !defined(__STRICT_ANSI__)
+
+ #endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
+
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
+
+ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
+ || !defined(__STRICT_ANSI__)
+
+ #endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
#ifndef __STRICT_ANSI__
- Raw text -