Created
September 8, 2014 15:30
-
-
Save weltling/90de6a090e75e59ec497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Zend/zend.c b/Zend/zend.c | |
index 334a8df..854e94c 100644 | |
--- a/Zend/zend.c | |
+++ b/Zend/zend.c | |
@@ -1031,11 +1031,10 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */ | |
} \ | |
} while (0) | |
-ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ | |
+static void zend_error_va_list(int type, const char *format, va_list args) /* {{{ */ | |
{ | |
char *str; | |
int len; | |
- va_list args; | |
va_list usr_copy; | |
zval params[5]; | |
zval retval; | |
@@ -1138,8 +1137,6 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ | |
} | |
#endif /* HAVE_DTRACE */ | |
- va_start(args, format); | |
- | |
/* if we don't have a user defined error handler */ | |
if (Z_TYPE(EG(user_error_handler)) == IS_UNDEF | |
|| !(EG(user_error_handler_error_reporting) & type) | |
@@ -1249,8 +1246,6 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ | |
break; | |
} | |
- va_end(args); | |
- | |
if (type == E_PARSE) { | |
/* eval() errors do not affect exit_status */ | |
if (!(EG(current_execute_data) && | |
@@ -1264,8 +1259,24 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ | |
} | |
/* }}} */ | |
-#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__) | |
-void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn)); | |
+ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ | |
+{ | |
+ va_list va; | |
+ | |
+ va_start(va, format); | |
+ zend_error_va_list(type, format, va); | |
+ va_end(va); | |
+} | |
+ | |
+#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__) || defined(ZEND_WIN32) | |
+ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) | |
+{ | |
+ va_list va; | |
+ | |
+ va_start(va, format); | |
+ zend_error_va_list(type, format, va); | |
+ va_end(va); | |
+} | |
#endif | |
ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */ | |
diff --git a/Zend/zend.h b/Zend/zend.h | |
index a0d8ba9..5bd16c6 100644 | |
--- a/Zend/zend.h | |
+++ b/Zend/zend.h | |
@@ -308,7 +308,10 @@ typedef enum { | |
#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__) | |
# define ZEND_NORETURN __attribute__((noreturn)) | |
-void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((noreturn)); | |
+ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...); | |
+#elif defined(ZEND_WIN32) | |
+# define ZEND_NORETURN __declspec(noreturn) | |
+ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...); | |
#else | |
# define ZEND_NORETURN | |
# define zend_error_noreturn zend_error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment