summaryrefslogtreecommitdiff
path: root/phpcpp.h
diff options
context:
space:
mode:
Diffstat (limited to 'phpcpp.h')
-rw-r--r--phpcpp.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/phpcpp.h b/phpcpp.h
index 439b51f..2a8517a 100644
--- a/phpcpp.h
+++ b/phpcpp.h
@@ -12,4 +12,17 @@
*/
#include <phpcpp/extension.h>
+/**
+ * Macro to export a function
+ */
+#if defined(__GNUC__) && __GNUC__ >= 4
+# define PHPCPP_EXPORT __attribute__ ((visibility("default")))
+#else
+# define PHPCPP_EXPORT
+#endif
+
+/**
+ * Macro to activate the extension
+ */
+#define PHP_CPP_EXTENSION(classname) extern "C" { PHPCPP_EXPORT void *get_module() { static classname extension; return extension.entry(); } }