]> sourceware.org Git - newlib-cygwin.git/commitdiff
2009-04-21 Mark Mitchell <mark@codesourcery.com>
authorJeff Johnston <jjohnstn@redhat.com>
Tue, 21 Apr 2009 18:24:59 +0000 (18:24 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Tue, 21 Apr 2009 18:24:59 +0000 (18:24 +0000)
        * 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.

newlib/ChangeLog
newlib/libc/include/_ansi.h
newlib/libc/include/stdlib.h

index 7e80ce48e0e4799368d99c14a6793723382ebd27..8997c2099ea4d40e4abb908ee445f4c3ca8871f3 100644 (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
index 3ece8e184acf44583d94051a3e92cfe22ce546a2..5b2da4e4b1d8c9307a60513dc7f5b40f67bc70dc 100644 (file)
 #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            ,
 #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
 #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_ */
index 5b44bb6e168f3f4cbd7c3b5b3de1c5d8da7adba8..7dfb7798326e6400e0733dea5a48085083d0a52f 100644 (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 *));
This page took 0.057637 seconds and 5 git commands to generate.