diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-01 10:51:37 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-01 10:51:37 +0100 |
commit | a05b25d54df9d42a8fe4632073538ba47eb710ab (patch) | |
tree | 30d8aa3bcf304800ba4c02ef8eaffb695bb10a0f /src | |
parent | c8d1519f31baed0fb399dac9333e48e2f9e910ad (diff) |
fixed various compile issues and namespace implementation
Diffstat (limited to 'src')
-rw-r--r-- | src/classbase.cpp | 8 | ||||
-rw-r--r-- | src/extension.cpp | 2 | ||||
-rw-r--r-- | src/namespace.cpp | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/classbase.cpp b/src/classbase.cpp index b38f6d3..71dd09d 100644 --- a/src/classbase.cpp +++ b/src/classbase.cpp @@ -165,9 +165,13 @@ void ClassBase::initialize(const std::string &prefix) // the class entry zend_class_entry entry; + std::cout << "prefix " << prefix << std::endl; + // update the name if (prefix.size() > 0) _name = prefix + "\\" + _name; + std::cout << "init class " << _name << std::endl; + // initialize the class entry INIT_CLASS_ENTRY_EX(entry, _name.c_str(), _name.size(), entries()); @@ -272,7 +276,7 @@ void ClassBase::add(const char *name, std::nullptr_t value, int flags) // add property _members.push_back(std::make_shared<NullMember>(name, flags)); } - + /** * Add a property to the class * @param name Name of the property @@ -368,7 +372,7 @@ void ClassBase::add(const char *name, double value, int flags) // add property _members.push_back(std::make_shared<FloatMember>(name, value, flags)); } - + /** * End namespace */ diff --git a/src/extension.cpp b/src/extension.cpp index 20d5627..89ec3b9 100644 --- a/src/extension.cpp +++ b/src/extension.cpp @@ -228,7 +228,7 @@ zend_module_entry *Extension::module() zend_function_entry *entries = new zend_function_entry[functions() + 1]; // initialize the entries - int count = initialize(_name, entries); + int count = Namespace::initialize("", entries); // last entry should be set to all zeros zend_function_entry *last = &entries[count]; diff --git a/src/namespace.cpp b/src/namespace.cpp index 0938a90..5efaf45 100644 --- a/src/namespace.cpp +++ b/src/namespace.cpp @@ -67,7 +67,7 @@ void Namespace::add(const char *name, native_callback_3 function, const Argument * @param entries The array to be filled * @return int Number of functions that were initialized */ -size_t Namespace::initialize(const std::string &parent, zend_function_entry entries[]) +size_t Namespace::initialize(const std::string &parent, struct _zend_function_entry entries[]) { // keep iterator counter int count = 0; |