summaryrefslogtreecommitdiff
path: root/include/sys/cdefs.h
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2001-05-26 01:50:21 +0000
committerDavid Schleef <ds@schleef.org>2001-05-26 01:50:21 +0000
commitc08da01578b2519d121cbff7ec22c8b22e2bb1bf (patch)
treeb7099452f32862e6c6cefad6748e29d4ad1e5c61 /include/sys/cdefs.h
parent86cffec4d5a8aa8c54bb3653cd289f4b92bfa3e1 (diff)
Added definition of __THROW
Diffstat (limited to 'include/sys/cdefs.h')
-rw-r--r--include/sys/cdefs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 4acb72b70..877746e47 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -28,4 +28,17 @@
#define __CONSTVALUE
#define __CONSTVALUE2
+#ifdef __GNUC__
+/* GCC can always grok prototypes. For C++ programs we add throw()
+ to help it optimize the function calls. But this works only with
+ gcc 2.8.x and egcs. */
+#if defined __cplusplus && __GNUC_PREREQ (2,8)
+#define __THROW throw()
+#else
+#define __THROW
+#endif
+#else /* GCC */
+#define __THROW
+#endif
+
#endif