move FIRM_NOTHROW, FIRM_PRINTF to obstack.h header
authorMatthias Braun <matze@braunis.de>
Wed, 14 Dec 2011 12:08:25 +0000 (13:08 +0100)
committerMatthias Braun <matze@braunis.de>
Wed, 14 Dec 2011 17:09:18 +0000 (18:09 +0100)
They are really special cases for obstack_printf, we don't need them for
all of libfirm.

include/libfirm/adt/obstack.h
include/libfirm/begin.h

index 973db84..8c81b33 100644 (file)
@@ -501,6 +501,27 @@ __extension__                                                              \
 
 #endif /* not __GNUC__ or not __STDC__ */
 
+/** @def FIRM_NOTHROW
+ * tells that a function does not throw C++ exceptions. Currently this is only
+ * necessary for obstack_printf to avoid nameclashes when linking with glibc
+ * which has an obstack library with NOTHROW builtin. */
+#ifdef __cplusplus
+# define FIRM_NOTHROW throw ()
+#else
+# define FIRM_NOTHROW
+#endif
+
+/**
+ * @def FIRM_PRINTF
+ * Attribute with marks a function to have a printf style format
+ * string and variadic argument.
+ */
+#if defined(__GNUC__)
+# define FIRM_PRINTF(a,b) __attribute__((__format__(__printf__, a, b)))
+#else
+# define FIRM_PRINTF(a,b)
+#endif
+
 /** prints formated string (printf-style format) to an obstack.
  * This is done by "growing" the obstack with the obstack_*grow*
  * functions. Note: Does NOT append a null-byte. */
index 0b4c537..770421f 100644 (file)
        #define  FIRM_API extern
 #endif
 
-#ifdef __cplusplus
-# define FIRM_NOTHROW throw ()
-#else
-# define FIRM_NOTHROW
-#endif
-
-/**
- * @def FIRM_PRINTF
- * Attribute with marks a function to have a printf style format
- * string and variadic argument.
- */
-#if defined(__GNUC__)
-# define FIRM_PRINTF(a,b) __attribute__((__format__(__printf__, a, b)))
-#else
-# define FIRM_PRINTF(a,b)
-#endif
-
 #endif
 
 /* mark declarations as C function (note that we always need this,