* 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 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
#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_ */
#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));
#define toascii(c) ((c)&0177)
#endif
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
#endif /* _CTYPE_H_ */
*/
#ifndef _LOCALE_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
#define _LOCALE_H_
#include "_ansi.h"
#define LC_TIME 5
#define LC_MESSAGES 6
+_BEGIN_STD_C
+
struct lconv
{
char *decimal_point;
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_ */
+
+_BEGIN_STD_C
+
#if defined(__arm__) || defined(__thumb__)
/*
* All callee preserved registers:
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];
sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
longjmp (env, val))
+#ifdef __cplusplus
+}
+#endif
#endif /* __CYGWIN__ or __rtems__ */
#endif
/* 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
#endif /* ! defined (__STRICT_ANSI__) */
+_END_STD_C
+
#ifdef __FAST_MATH__
#include <machine/fastmath.h>
#endif
-#ifdef __cplusplus
-}
-#endif
#endif /* _MATH_H_ */
*/
#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_ */
#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)
int _EXFUN(raise, (int));
#endif
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
#endif /* _SIGNAL_H_ */
*/
#ifndef _STDIO_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
#define _STDIO_H_
#include "_ansi.h"
#include <sys/reent.h>
#include <sys/types.h>
+_BEGIN_STD_C
+
typedef _fpos_t fpos_t;
typedef struct __sFILE FILE;
#endif
#endif
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
#endif /* _STDIO_H_ */
*/
#ifndef _STDLIB_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
#define _STDLIB_H_
#include "_ansi.h"
#include <alloca.h>
#endif
+_BEGIN_STD_C
+
typedef struct
{
int quot; /* quotient */
_VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
#endif /* _STDLIB_H_ */
#ifndef _STRING_H_
#define _STRING_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "_ansi.h"
#include <sys/reent.h>
#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));
#endif /* ! __STRICT_ANSI__ */
-#ifdef __cplusplus
-}
-#endif
+_END_STD_C
+
#endif /* _STRING_H_ */
#include "_ansi.h"
#include <sys/reent.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifndef NULL
#define NULL 0
#endif
#include <sys/types.h>
+_BEGIN_STD_C
+
struct tm
{
int tm_sec;
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));
#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));
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 */
#ifdef __cplusplus
}
#endif
+
#endif /* _TIME_H_ */