summaryrefslogtreecommitdiff
path: root/phpcpp.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-24 19:44:19 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-24 19:44:19 +0200
commitb8a14d96c06d5a8910cb28d28870f0036ae6a461 (patch)
tree5077e7af0a04ce093dded091747c047b1ad05478 /phpcpp.h
parentd29c1a960798bbfa351b1aa3426d6f0a79ffe92c (diff)
The extension::initialize() and extension::finalize() methods are called at the appropriate time
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(); } }