OSDN Git Service

2002-06-27 Benjamin Kosnik <bkoz@redhat.com>
authorjjohnstn <jjohnstn>
Thu, 27 Jun 2002 23:58:36 +0000 (23:58 +0000)
committerjjohnstn <jjohnstn>
Thu, 27 Jun 2002 23:58:36 +0000 (23:58 +0000)
        * libc/include/stdio.h: Untangle, add _BEGIN_STD_C and _END_STD_C.
        * libc/include/time.h: Same.
        * libc/include/string.h: Same.
        * libc/include/stdlib.h: Same.
        * libc/include/signal.h: Same.
        * libc/include/setjmp.h: Same.
        * libc/include/math.h: Same.
        * libc/include/locale.h: Same.
        * libc/include/ctype.h: Same.
        * libc/include/machine/setjmp.h: Same.
        * libc/include/_ansi.h (_BEGIN_STD_C): Add.
        (_END_STD_C): Add.

12 files changed:
newlib/ChangeLog
newlib/libc/include/_ansi.h
newlib/libc/include/ctype.h
newlib/libc/include/locale.h
newlib/libc/include/machine/setjmp.h
newlib/libc/include/math.h
newlib/libc/include/setjmp.h
newlib/libc/include/signal.h
newlib/libc/include/stdio.h
newlib/libc/include/stdlib.h
newlib/libc/include/string.h
newlib/libc/include/time.h

index 66461ef..e057f2e 100644 (file)
@@ -1,3 +1,18 @@
+2002-06-27  Benjamin Kosnik  <bkoz@redhat.com>
+
+        * libc/include/stdio.h: Untangle, add _BEGIN_STD_C and _END_STD_C.
+        * libc/include/time.h: Same.
+        * libc/include/string.h: Same.
+        * libc/include/stdlib.h: Same.
+        * libc/include/signal.h: Same.
+        * libc/include/setjmp.h: Same.
+        * libc/include/math.h: Same.
+        * libc/include/locale.h: Same.
+        * libc/include/ctype.h: Same.
+        * libc/include/machine/setjmp.h: Same.
+        * libc/include/_ansi.h (_BEGIN_STD_C): Add.
+        (_END_STD_C): Add.
+
 2002-06-27  Jeff Johnston  <jjohnstn@redhat.com>
 
         * libc/include/sys/_types.h: Define _ssize_t as int if int is
index 8bebd14..6c7beb3 100644 (file)
 #define _ATTRIBUTE(attrs)
 #endif
 
+/*  ISO C++.  */
+
+#ifdef __cplusplus
+#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C))
+#ifdef _HAVE_STD_CXX
+#define _BEGIN_STD_C namespace std { extern "C" {
+#define _END_STD_C  } }
+#else
+#define _BEGIN_STD_C extern "C" {
+#define _END_STD_C  }
+#endif
+#endif
+#else
+#define _BEGIN_STD_C
+#define _END_STD_C
+#endif
+
 #endif /* _ANSIDECL_H_ */
index 194a52b..a3581df 100644 (file)
@@ -1,11 +1,10 @@
 #ifndef _CTYPE_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
 #define _CTYPE_H_
 
 #include "_ansi.h"
 
+_BEGIN_STD_C
+
 int _EXFUN(isalnum, (int __c));
 int _EXFUN(isalpha, (int __c));
 int _EXFUN(iscntrl, (int __c));
@@ -66,7 +65,6 @@ extern        __IMPORT _CONST char    _ctype_[];
 #define toascii(c)     ((c)&0177)
 #endif
 
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
 #endif /* _CTYPE_H_ */
index 4718248..ebe1422 100644 (file)
@@ -5,9 +5,6 @@
 */
 
 #ifndef _LOCALE_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
 #define _LOCALE_H_
 
 #include "_ansi.h"
@@ -24,6 +21,8 @@ extern "C" {
 #define LC_TIME     5
 #define LC_MESSAGES 6
 
+_BEGIN_STD_C
+
 struct lconv
 {
   char *decimal_point;
@@ -55,7 +54,6 @@ struct _reent;
 char *_EXFUN(_setlocale_r,(struct _reent *, int category, const char *locale));
 struct lconv *_EXFUN(_localeconv_r,(struct _reent *));
 
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
 #endif /* _LOCALE_H_ */
index dfdedc5..42c982c 100644 (file)
@@ -1,3 +1,6 @@
+
+_BEGIN_STD_C
+
 #if defined(__arm__) || defined(__thumb__)
 /*
  * All callee preserved registers:
@@ -176,9 +179,15 @@ typedef    _JBTYPE jmp_buf[_JBLEN];
 typedef        int jmp_buf[_JBLEN];
 #endif
 
+_END_STD_C
+
 #if defined(__CYGWIN__) || defined(__rtems__)
 #include <signal.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* POSIX sigsetjmp/siglongjmp macros */
 typedef int sigjmp_buf[_JBLEN+2];
 
@@ -197,5 +206,8 @@ typedef int sigjmp_buf[_JBLEN+2];
                sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
                longjmp (env, val))
 
+#ifdef __cplusplus
+}
+#endif
 #endif /* __CYGWIN__ or __rtems__ */
 #endif
index c0a743d..f1a30ad 100644 (file)
@@ -1,15 +1,14 @@
 /* math.h -- Definitions for the math floating point package.  */
 
 #ifndef  _MATH_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
 #define  _MATH_H_
 
 #include <sys/reent.h>
 #include <machine/ieeefp.h>
 #include "_ansi.h"
 
+_BEGIN_STD_C
+
 #ifndef HUGE_VAL
 
 /* Define HUGE_VAL as infinity, unless HUGE_VAL is already defined
@@ -359,11 +358,10 @@ extern __IMPORT _CONST _LIB_VERSION_TYPE _LIB_VERSION;
 
 #endif /* ! defined (__STRICT_ANSI__) */
 
+_END_STD_C
+
 #ifdef __FAST_MATH__
 #include <machine/fastmath.h>
 #endif
 
-#ifdef __cplusplus
-}
-#endif
 #endif /* _MATH_H_ */
index 53d0223..c958d90 100644 (file)
@@ -4,19 +4,17 @@
 */
 
 #ifndef _SETJMP_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
 #define _SETJMP_H_
 
 #include "_ansi.h"
 #include <machine/setjmp.h>
 
+_BEGIN_STD_C
+
 void   _EXFUN(longjmp,(jmp_buf __jmpb, int __retval));
 int    _EXFUN(setjmp,(jmp_buf __jmpb));
 
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
 #endif /* _SETJMP_H_ */
 
index 3111491..e1170a2 100644 (file)
@@ -1,12 +1,11 @@
 #ifndef _SIGNAL_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
 #define _SIGNAL_H_
 
 #include "_ansi.h"
 #include <sys/signal.h>
 
+_BEGIN_STD_C
+
 typedef int    sig_atomic_t;           /* Atomic entity type (ANSI) */
 
 #if defined(__STDC__) || defined(__cplusplus)
@@ -31,7 +30,6 @@ _sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr));
 int    _EXFUN(raise, (int));
 #endif
 
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
 #endif /* _SIGNAL_H_ */
index 51403a3..cbb53b9 100644 (file)
@@ -24,9 +24,6 @@
  */
 
 #ifndef _STDIO_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
 #define        _STDIO_H_
 
 #include "_ansi.h"
@@ -48,6 +45,8 @@ extern "C" {
 #include <sys/reent.h>
 #include <sys/types.h>
 
+_BEGIN_STD_C
+
 typedef _fpos_t fpos_t;
 typedef struct __sFILE FILE;
 
@@ -385,7 +384,6 @@ static __inline int __sputc(int _c, FILE *_p) {
 #endif
 #endif
 
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
 #endif /* _STDIO_H_ */
index e2dab04..d7401ec 100644 (file)
@@ -5,9 +5,6 @@
  */
 
 #ifndef _STDLIB_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
 #define _STDLIB_H_
 
 #include "_ansi.h"
@@ -22,6 +19,8 @@ extern "C" {
 #include <alloca.h>
 #endif
 
+_BEGIN_STD_C
+
 typedef struct 
 {
   int quot; /* quotient */
@@ -176,7 +175,6 @@ int _EXFUN(_system_r,(struct _reent *, const char *));
 
 _VOID  _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));
 
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
 #endif /* _STDLIB_H_ */
index 9db1767..84cb4b1 100644 (file)
@@ -7,10 +7,6 @@
 #ifndef _STRING_H_
 #define        _STRING_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include "_ansi.h"
 #include <sys/reent.h>
 
@@ -21,6 +17,8 @@ extern "C" {
 #define NULL 0
 #endif
 
+_BEGIN_STD_C
+
 _PTR    _EXFUN(memchr,(const _PTR, int, size_t));
 int     _EXFUN(memcmp,(const _PTR, const _PTR, size_t));
 _PTR    _EXFUN(memcpy,(_PTR, const _PTR, size_t));
@@ -94,7 +92,6 @@ char  *_EXFUN(strsignal, (int __signo));
 
 #endif /* ! __STRICT_ANSI__ */
 
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
 #endif /* _STRING_H_ */
index 9b16417..1ff5b82 100644 (file)
 #include "_ansi.h"
 #include <sys/reent.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #ifndef NULL
 #define        NULL    0
 #endif
@@ -32,6 +28,8 @@ extern "C" {
 
 #include <sys/types.h>
 
+_BEGIN_STD_C
+
 struct tm
 {
   int  tm_sec;
@@ -62,6 +60,12 @@ char   *_EXFUN(ctime_r,      (const time_t *, char *));
 struct tm *_EXFUN(gmtime_r,    (const time_t *, struct tm *));
 struct tm *_EXFUN(localtime_r, (const time_t *, struct tm *));
 
+_END_STD_C
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef __STRICT_ANSI__
 char      *_EXFUN(strptime,     (const char *, const char *, struct tm *));
 _VOID      _EXFUN(tzset,       (_VOID));
@@ -115,12 +119,20 @@ char *_EXFUN(timezone, (void));
 #endif /* __CYGWIN__ */
 #endif /* !__STRICT_ANSI__ */
 
+#ifdef __cplusplus
+}
+#endif
+
 #include <sys/features.h>
 
 #if defined(_POSIX_TIMERS)
 
 #include <signal.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Clocks, P1003.1b-1993, p. 263 */
 
 int _EXFUN(clock_settime, (clockid_t clock_id, const struct timespec *tp));
@@ -148,8 +160,15 @@ int _EXFUN(timer_getoverrun, (timer_t timerid));
 
 int _EXFUN(nanosleep, (const struct timespec  *rqtp, struct timespec *rmtp));
 
+#ifdef __cplusplus
+}
+#endif
 #endif /* _POSIX_TIMERS */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* CPU-time Clock Attributes, P1003.4b/D8, p. 54 */
 
 /* values for the clock enable attribute */
@@ -217,5 +236,6 @@ int _EXFUN(clock_getenable_attr, (clockid_t clock_id, int *attr));
 #ifdef __cplusplus
 }
 #endif
+
 #endif /* _TIME_H_ */