summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include/_ansi.h
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include/_ansi.h')
-rw-r--r--newlib/libc/include/_ansi.h45
1 files changed, 28 insertions, 17 deletions
diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h
index 3ece8e184..5b2da4e4b 100644
--- a/newlib/libc/include/_ansi.h
+++ b/newlib/libc/include/_ansi.h
@@ -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_ */