cvs: Zend(PHP_4_3) / zend.h
| From: | Sascha Schumann | Date: | Thu, 28 Aug 2003 17:29:43 +0000 |
| Subject: | cvs: Zend(PHP_4_3) / zend.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1728@lists.php.net to get a copy of this message | ||
sas Thu Aug 28 13:29:43 2003 EDT
Modified files: (Branch: PHP_4_3)
/Zend zend.h
Log:
older gccs don't understand attribute((format)) on function pointers
Index: Zend/zend.h
diff -u Zend/zend.h:1.164.2.13 Zend/zend.h:1.164.2.14
--- Zend/zend.h:1.164.2.13 Thu Aug 28 13:05:10 2003
+++ Zend/zend.h Thu Aug 28 13:29:43 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.h,v 1.164.2.13 2003/08/28 17:05:10 sas Exp $ */
+/* $Id: zend.h,v 1.164.2.14 2003/08/28 17:29:43 sas Exp $ */
#ifndef ZEND_H
#define ZEND_H
@@ -152,6 +152,12 @@
# define ZEND_ATTRIBUTE_FORMAT(type, idx, first)
#endif
+#if ZEND_GCC_VERSION >= 3000
+# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
+#else
+# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first)
+#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)
@@ -302,8 +308,8 @@
typedef struct _zend_utility_functions {
- void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char
*format, va_list args) ZEND_ATTRIBUTE_FORMAT(printf, 4, 0);
- int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
+ void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char
*format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
+ int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
int (*write_function)(const char *str, uint str_length);
FILE *(*fopen_function)(const char *filename, char **opened_path);
void (*message_handler)(long message, void *data);
@@ -435,18 +441,18 @@
BEGIN_EXTERN_C()
-extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
+extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1,
2);
extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
extern ZEND_API zend_bool (*zend_open)(const char *filename, struct _zend_file_handle *fh);
extern ZEND_API void (*zend_block_interruptions)(void);
extern ZEND_API void (*zend_unblock_interruptions)(void);
extern ZEND_API void (*zend_ticks_function)(int ticks);
-extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint
error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_FORMAT(printf, 4, 0);
+extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint
error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern void (*zend_on_timeout)(int seconds TSRMLS_DC);
-ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 2,
3);
void zenderror(char *error);