From 89ecd499372006196a4c2f63a5e719b5f1288572 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 14 Dec 2011 13:08:25 +0100 Subject: [PATCH] move FIRM_NOTHROW, FIRM_PRINTF to obstack.h header They are really special cases for obstack_printf, we don't need them for all of libfirm. --- include/libfirm/adt/obstack.h | 21 +++++++++++++++++++++ include/libfirm/begin.h | 17 ----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/include/libfirm/adt/obstack.h b/include/libfirm/adt/obstack.h index 973db8412..8c81b33d7 100644 --- a/include/libfirm/adt/obstack.h +++ b/include/libfirm/adt/obstack.h @@ -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. */ diff --git a/include/libfirm/begin.h b/include/libfirm/begin.h index 0b4c53742..770421f2d 100644 --- a/include/libfirm/begin.h +++ b/include/libfirm/begin.h @@ -48,23 +48,6 @@ #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, -- 2.20.1