#define FIRM_BEGIN_H
/**
- * @def FIRM_DLL
+ * @def FIRM_API
* Declaration specifier which marks a function/variable as being publicly
* visible outside the firm library/dll
*/
-#ifdef FIRM_BUILD_DLL
- #ifdef _WIN32
- #define FIRM_DLL extern __declspec(dllexport)
+#ifdef FIRM_DLL
+ #ifdef FIRM_BUILD
+ #ifdef _WIN32
+ #define FIRM_API extern __declspec(dllexport)
+ #else
+ #define FIRM_API extern __attribute__((visibility("default")))
+ #endif
#else
- #define FIRM_DLL extern __attribute__((visibility("default")))
+ #ifdef _WIN32
+ #define FIRM_API extern __declspec(dllimport)
+ #else
+ #define FIRM_API extern
+ #endif
#endif
#else
- #ifdef _WIN32
- #define FIRM_DLL extern __declspec(dllimport)
- #else
- #define FIRM_DLL
- #endif
+ #define FIRM_API extern
#endif
-/* mark declarations as C function */
#ifdef __cplusplus
-extern "C" {
+# 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,
+ * so don't put it in the include guard) */
+#ifdef __cplusplus
+extern "C" {
#endif