cvs: Zend(PHP_4_3) / zend.h zend_alloc.h
| From: | Sascha Schumann | Date: | Thu, 28 Aug 2003 14:46:51 +0000 |
| Subject: | cvs: Zend(PHP_4_3) / zend.h zend_alloc.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1717@lists.php.net to get a copy of this message | ||
sas Thu Aug 28 10:46:51 2003 EDT
Modified files: (Branch: PHP_4_3)
/Zend zend.h zend_alloc.h
Log:
cleanup & centralize ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC so that
it can be used by downstream applications
Index: Zend/zend.h
diff -u Zend/zend.h:1.164.2.10 Zend/zend.h:1.164.2.11
--- Zend/zend.h:1.164.2.10 Mon Aug 25 19:24:43 2003
+++ Zend/zend.h Thu Aug 28 10:46:51 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.h,v 1.164.2.10 2003/08/25 23:24:43 sniper Exp $ */
+/* $Id: zend.h,v 1.164.2.11 2003/08/28 14:46:51 sas Exp $ */
#ifndef ZEND_H
#define ZEND_H
@@ -132,6 +132,18 @@
# endif
# endif
# 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))
Index: Zend/zend_alloc.h
diff -u Zend/zend_alloc.h:1.39.4.5 Zend/zend_alloc.h:1.39.4.6
--- Zend/zend_alloc.h:1.39.4.5 Thu Aug 28 07:54:18 2003
+++ Zend/zend_alloc.h Thu Aug 28 10:46:51 2003
@@ -59,16 +59,10 @@
#define MAX_CACHED_ENTRIES 256
#define PRE_INIT_CACHE_ENTRIES 32
-#if __GNUC__ -0 >= 2
+#if ZEND_GCC_VERSION >= 2000
# define PLATFORM_ALIGNMENT (__alignof__ (align_test))
#else
# define PLATFORM_ALIGNMENT (sizeof(align_test))
-#endif
-
-#if GCC_VERSION - 0 >= 2096
-# define ZEND_ATTRIBUTE_MALLOC __attribute__ ((malloc))
-#else
-# define ZEND_ATTRIBUTE_MALLOC
#endif
#define MEM_HEADER_PADDING
(((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)