diff options
Diffstat (limited to 'phpcpp.h')
-rw-r--r-- | phpcpp.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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(); } } |