diff options
author | Martijn Otto <martijn.otto@copernica.com> | 2014-02-14 16:30:23 +0100 |
---|---|---|
committer | Martijn Otto <martijn.otto@copernica.com> | 2014-02-14 16:30:23 +0100 |
commit | 06aa5fd5afaba69544b93654fb0a4f9c2651306e (patch) | |
tree | 99cd2ee120786a84531b450f9ef64e2319ef5192 /src/longmember.h | |
parent | 5c23fee5ce58ae66a70f3bd19a1dc2dff7220f13 (diff) |
Merged pull request #14
Diffstat (limited to 'src/longmember.h')
-rw-r--r-- | src/longmember.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/longmember.h b/src/longmember.h index b35c316..4adf59b 100644 --- a/src/longmember.h +++ b/src/longmember.h @@ -51,12 +51,28 @@ public: */ virtual void declare(struct _zend_class_entry *entry, const char *name, int size, int flags) { -#if PHP_VERSION_ID >= 50400 +#if PHP_VERSION_ID >= 50400 zend_declare_property_long(entry, name, size, _value, flags); #else zend_declare_property_long(entry, (char *) name, size, _value, flags); #endif } + + /** + * Virtual method to declare the class constant + * @param entry Class entry + * @param name Name of the member + * @param size Size of the name + * @param flags Additional flags + */ + virtual void declareConst(struct _zend_class_entry *entry, const char *name, int size) + { +#if PHP_VERSION_ID >= 50400 + zend_declare_class_constant_long(entry, name, size, _value); +#else + zend_declare_class_constant_long(entry, (char *) name, size, _value); +#endif + } }; /** |