diff options
Diffstat (limited to 'Zend/zend.h')
-rw-r--r-- | Zend/zend.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/Zend/zend.h b/Zend/zend.h index b6c1a5b8a6..aed03d8715 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -22,7 +22,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "2.4.0" +#define ZEND_VERSION "2.5.0-dev" #define ZEND_ENGINE_2 @@ -133,6 +133,11 @@ char *alloca (); # endif #endif +/* Compatibility with non-clang compilers */ +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif + /* GCC x.y.z supplies __GNUC__ = x and __GNUC_MINOR__ = y */ #ifdef __GNUC__ # define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) @@ -146,6 +151,14 @@ char *alloca (); # define ZEND_ATTRIBUTE_MALLOC #endif +#if ZEND_GCC_VERSION >= 4003 || __has_attribute(alloc_size) +# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) __attribute__ ((alloc_size(X))) +# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) __attribute__ ((alloc_size(X,Y))) +#else +# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) +# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) +#endif + #if ZEND_GCC_VERSION >= 2007 # define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first))) #else @@ -212,6 +225,7 @@ char *alloca (); #define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C #define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno #define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C +#define ZEND_ASSERT(c) assert(c) #else #define ZEND_FILE_LINE_D #define ZEND_FILE_LINE_DC @@ -225,6 +239,7 @@ char *alloca (); #define ZEND_FILE_LINE_EMPTY_CC #define ZEND_FILE_LINE_ORIG_RELAY_C #define ZEND_FILE_LINE_ORIG_RELAY_CC +#define ZEND_ASSERT(c) #endif /* ZEND_DEBUG */ #ifdef ZTS @@ -263,10 +278,10 @@ static const char long_min_digits[] = "9223372036854775808"; #define MAX_LENGTH_OF_DOUBLE 32 -#undef SUCCESS -#undef FAILURE -#define SUCCESS 0 -#define FAILURE -1 /* this MUST stay a negative number, or it may affect functions! */ +typedef enum { + SUCCESS = 0, + FAILURE = -1, /* this MUST stay a negative number, or it may affect functions! */ +} ZEND_RESULT_CODE; #include "zend_hash.h" #include "zend_ts_hash.h" @@ -436,8 +451,6 @@ struct _zend_trait_precedence { zend_trait_method_reference *trait_method; zend_class_entry** exclude_from_classes; - - union _zend_function* function; /* FIXME: kept in 5.4 for BC, not used */ }; typedef struct _zend_trait_precedence zend_trait_precedence; @@ -454,8 +467,6 @@ struct _zend_trait_alias { * modifiers to be set on trait method */ zend_uint modifiers; - - union _zend_function* function; /* FIXME: kept in 5.4 for BC, not used */ }; typedef struct _zend_trait_alias zend_trait_alias; |