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.
This commit is contained in:
Jeff Johnston 2002-06-27 23:58:38 +00:00
parent 533b4e6644
commit c1a3171f2d
12 changed files with 100 additions and 53 deletions

View 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

View File

@ -74,4 +74,21 @@
#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_ */

View 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_ */

View 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_ */

View 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

View 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_ */

View 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_ */

View 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_ */

View 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_ */

View 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_ */

View 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_ */

View File

@ -10,10 +10,6 @@
#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_ */