From 73945a9cb2b096a5379d17c028bda102b87aedce Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Fri, 28 Feb 2014 16:06:23 +0100 Subject: various fixes to make the classes example functional again --- src/classbase.cpp | 2 +- src/member.h | 2 +- src/method.h | 4 ++++ src/modifiers.cpp | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/classbase.cpp b/src/classbase.cpp index da705b6..38972f5 100644 --- a/src/classbase.cpp +++ b/src/classbase.cpp @@ -198,7 +198,7 @@ void ClassBase::initialize() #endif // set access types flags for class - _entry->ce_flags = flags; + _entry->ce_flags = _flags; // declare all member variables for (auto &member : _members) member->initialize(_entry); diff --git a/src/member.h b/src/member.h index a1bce52..3ccdfad 100644 --- a/src/member.h +++ b/src/member.h @@ -30,7 +30,7 @@ public: /** * Destructor */ - virtual ~Member(); + virtual ~Member() {} /** * Initialize the member diff --git a/src/method.h b/src/method.h index cc9f973..6a91068 100644 --- a/src/method.h +++ b/src/method.h @@ -46,6 +46,10 @@ public: */ void initialize(struct _zend_function_entry *entry, const std::string &classname) { + // fix the flags, if neither public, private and protected is set, we use public, + // (this solves php warnings if only "final" or only "abstract" is set + if ((_flags & (Public|Private|Protected)) == 0) _flags |= Public; + // call base Callable::initialize(entry, classname.c_str(), _flags); } diff --git a/src/modifiers.cpp b/src/modifiers.cpp index 946b910..c987b8a 100644 --- a/src/modifiers.cpp +++ b/src/modifiers.cpp @@ -7,6 +7,7 @@ * @author Martijn Otto * @copyright 2014 Copernica BV */ +#include "includes.h" /** * Set up namespace -- cgit v1.2.3