4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-30 02:50:25 +08:00

2009-04-21 Mark Mitchell <mark@codesourcery.com>

* libc/include/_ansi.h: Move C++ defines to top of file.
        (_NOTHROW): New macro.
        (_EXFUN_NOTHROW): Likewise.
        * libc/include/stdlib.h (calloc): Declare with _EXFUN_NOTHROW.
        (free): Likewise.
        (malloc): Likewise.
        (realloc): Likewise.
        (_malloc_r): Likewise.
        (_callor_r): Likewise.
        (_free_r): Likewise.
        (_realloc_r): Likewise.
This commit is contained in:
Jeff Johnston 2009-04-21 18:24:59 +00:00
parent 6e9c1e8dd5
commit 15b71e6679
3 changed files with 50 additions and 25 deletions

View File

@ -1,3 +1,17 @@
2009-04-21 Mark Mitchell <mark@codesourcery.com>
* libc/include/_ansi.h: Move C++ defines to top of file.
(_NOTHROW): New macro.
(_EXFUN_NOTHROW): Likewise.
* libc/include/stdlib.h (calloc): Declare with _EXFUN_NOTHROW.
(free): Likewise.
(malloc): Likewise.
(realloc): Likewise.
(_malloc_r): Likewise.
(_callor_r): Likewise.
(_free_r): Likewise.
(_realloc_r): Likewise.
2009-04-20 Jeff johnston <jjohnstn@redhat.com>
* libc/include/math.h: Change _LDBL_EQ_DBL flag usage to

View File

@ -23,6 +23,31 @@
#define _HAVE_STDC
#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
#if defined(__GNUC__) && \
( (__GNUC__ >= 4) || \
( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) )
#define _NOTHROW __attribute__ ((nothrow))
#else
#define _NOTHROW throw()
#endif
#endif
#else
#define _BEGIN_STD_C
#define _END_STD_C
#define _NOTHROW
#endif
#ifdef _HAVE_STDC
#define _PTR void *
#define _AND ,
@ -33,9 +58,11 @@
#define _DOTS , ...
#define _VOID void
#ifdef __CYGWIN__
#define _EXFUN_NOTHROW(name, proto) __cdecl name proto _NOTHROW
#define _EXFUN(name, proto) __cdecl name proto
#define _EXPARM(name, proto) (* __cdecl name) proto
#else
#define _EXFUN_NOTHROW(name, proto) name proto _NOTHROW
#define _EXFUN(name, proto) name proto
#define _EXPARM(name, proto) (* name) proto
#endif
@ -61,6 +88,7 @@
#define _DOTS
#define _VOID void
#define _EXFUN(name, proto) name()
#define _EXFUN_NOTHROW(name, proto) name()
#define _DEFUN(name, arglist, args) name arglist args;
#define _DEFUN_VOID(name) name()
#define _CAST_VOID
@ -100,21 +128,4 @@
#define _ELIDABLE_INLINE __inline__
#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

@ -75,17 +75,17 @@ _PTR _EXFUN(bsearch,(const _PTR __key,
size_t __nmemb,
size_t __size,
int _EXPARM(_compar,(const _PTR, const _PTR))));
_PTR _EXFUN(calloc,(size_t __nmemb, size_t __size));
_PTR _EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size));
div_t _EXFUN(div,(int __numer, int __denom));
_VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((noreturn)));
_VOID _EXFUN(free,(_PTR));
_VOID _EXFUN_NOTHROW(free,(_PTR));
char * _EXFUN(getenv,(const char *__string));
char * _EXFUN(_getenv_r,(struct _reent *, const char *__string));
char * _EXFUN(_findenv,(_CONST char *, int *));
char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));
long _EXFUN(labs,(long));
ldiv_t _EXFUN(ldiv,(long __numer, long __denom));
_PTR _EXFUN(malloc,(size_t __size));
_PTR _EXFUN_NOTHROW(malloc,(size_t __size));
int _EXFUN(mblen,(const char *, size_t));
int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *));
int _EXFUN(mbtowc,(wchar_t *, const char *, size_t));
@ -106,7 +106,7 @@ char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((warning ("the us
#endif
_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR)));
int _EXFUN(rand,(_VOID));
_PTR _EXFUN(realloc,(_PTR __r, size_t __size));
_PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size));
#ifndef __STRICT_ANSI__
_PTR _EXFUN(reallocf,(_PTR __r, size_t __size));
#endif
@ -189,10 +189,10 @@ int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string));
char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));
#ifndef __CYGWIN__
_PTR _EXFUN(_malloc_r,(struct _reent *, size_t));
_PTR _EXFUN(_calloc_r,(struct _reent *, size_t, size_t));
_VOID _EXFUN(_free_r,(struct _reent *, _PTR));
_PTR _EXFUN(_realloc_r,(struct _reent *, _PTR, size_t));
_PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t));
_PTR _EXFUN_NOTHROW(_calloc_r,(struct _reent *, size_t, size_t));
_VOID _EXFUN_NOTHROW(_free_r,(struct _reent *, _PTR));
_PTR _EXFUN_NOTHROW(_realloc_r,(struct _reent *, _PTR, size_t));
_VOID _EXFUN(_mstats_r,(struct _reent *, char *));
#endif
int _EXFUN(_system_r,(struct _reent *, const char *));