From cbc98a28b2c0b8373cff40e357f262bec1b759b2 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Mon, 13 Apr 2015 21:03:15 +0200 Subject: added PHPCPP_EXPORT, this may fix visibility issue #186 --- Examples/Globals/Makefile | 2 +- include/super.h | 14 +++++++------- zend/module.h | 4 +++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Examples/Globals/Makefile b/Examples/Globals/Makefile index a38d8c8..fec79f7 100644 --- a/Examples/Globals/Makefile +++ b/Examples/Globals/Makefile @@ -3,7 +3,7 @@ RM = rm -f CPP_FLAGS = -Wall -c -I. -O2 -std=c++11 PREFIX = /usr -#Edit these lines to correspond with your own directories +PHP_CONFIG = php-config LIBRARY_DIR = $(shell ${PHP_CONFIG} --extension-dir) PHP_CONFIG_DIR = /etc/php5/cli/conf.d diff --git a/include/super.h b/include/super.h index 154ae62..d12d376 100644 --- a/include/super.h +++ b/include/super.h @@ -113,13 +113,13 @@ private: /** * A number of super-globals are always accessible */ -extern Super POST; -extern Super GET; -extern Super COOKIE; -extern Super SERVER; -extern Super ENV; -extern Super FILES; -extern Super REQUEST; +extern PHPCPP_EXPORT Super POST; +extern PHPCPP_EXPORT Super GET; +extern PHPCPP_EXPORT Super COOKIE; +extern PHPCPP_EXPORT Super SERVER; +extern PHPCPP_EXPORT Super ENV; +extern PHPCPP_EXPORT Super FILES; +extern PHPCPP_EXPORT Super REQUEST; /** * End namespace diff --git a/zend/module.h b/zend/module.h index 40cd6f7..374c9d6 100644 --- a/zend/module.h +++ b/zend/module.h @@ -195,8 +195,10 @@ public: if (!valid()) return false; // the Zend engine sets a number of properties in the entry class, we do that here too + // note that it would be better to call zend_next_free_module() to find the next module + // number, but some users complain that this function is not always available _entry->type = MODULE_TEMPORARY; - _entry->module_number = zend_next_free_module(); + _entry->module_number = zend_hash_num_elements(&module_registry) + 1; _entry->handle = _handle; // @todo does loading an extension even work in a multi-threading setup? -- cgit v1.2.3