summaryrefslogtreecommitdiff
path: root/include/visibility.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/visibility.h')
-rw-r--r--include/visibility.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/visibility.h b/include/visibility.h
new file mode 100644
index 0000000..afb8a6b
--- /dev/null
+++ b/include/visibility.h
@@ -0,0 +1,30 @@
+/**
+ * visibility.h
+ *
+ * This file defines macros used to define whether a symbol
+ * should be exported. It is only used for classes and
+ * functions that are defined in the public API to reduce
+ * the size of the symbol table, make linking and loading
+ * of the PHP-CPP library faster and generate more
+ * optimized code as a result.
+ *
+ * @copyright 2015 Copernica B.V.
+ */
+
+#if defined _WIN32 || defined __CYGWIN__
+ #ifdef BUILDING_PHPCPP
+ #ifdef __GNUC__
+ #define PHPCPP_EXPORT __attribute__ ((dllexport))
+ #else
+ #define PHPCPP_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
+ #endif
+ #else
+ #ifdef __GNUC__
+ #define DLL_EXPORT __attribute__ ((dllimport))
+ #else
+ #define DLL_EXPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
+ #endif
+ #endif
+#else
+ #define PHPCPP_EXPORT __attribute__ ((visibility ("default")))
+#endif