summaryrefslogtreecommitdiff
path: root/Zend/zend.h
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2003-08-28 14:53:02 +0000
committerSascha Schumann <sas@php.net>2003-08-28 14:53:02 +0000
commit169d43e5fa3744e4c9ddd851e6b0f3c7773b65c4 (patch)
treead6254875ac6b46bd684db246c5003cbe9ecc085 /Zend/zend.h
parent367880b2c150002144d7a2eac92e36e47ce6dcea (diff)
downloadphp-git-169d43e5fa3744e4c9ddd851e6b0f3c7773b65c4.tar.gz
cleanup & centralize ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC so that
they can be used by downstream applications
Diffstat (limited to 'Zend/zend.h')
-rw-r--r--Zend/zend.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Zend/zend.h b/Zend/zend.h
index 65dc1ee885..fea87092f3 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -146,6 +146,18 @@ char *alloca ();
# endif
#endif
+#ifdef __GNUC__
+# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+#else
+# define ZEND_GCC_VERSION
+#endif
+
+#if ZEND_GCC_VERSION >= 2096
+# define ZEND_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define ZEND_ATTRIBUTE_MALLOC
+#endif
+
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX))
# define do_alloca(p) alloca(p)
# define free_alloca(p)