Commits

Anatol Belski committed ed20d7b

fix NTS build

  • Participants
  • Parent commits b8f01dc

Comments (0)

Files changed (3)

  * Overrides libevent's default error logging(it logs to stderr) */
 static void log_cb(int severity, const char *msg)
 {
+	int error_type;
+
 	/* TSRMLS_FETCH consumes a fair amount of resources.  But a ready-to-use
 	 * program shouldn't get any error logs. Nevertheless, we have no other way
 	 * to fetch TSRMLS. */
 	TSRMLS_FETCH();
 
-	int error_type;
-
 	switch (severity) {
 		case PHP_EVENT_LOG_CONST(EVENT_LOG_DEBUG):
 			error_type = E_STRICT;

File src/structs.h

 /* Thread context. With it we are getting rid of need
  * to call the heavy TSRMLS_FETCH() */
 #ifdef ZTS
-# define PHP_EVENT_COMMON_THREAD_CTX void ***thread_ctx
+# define PHP_EVENT_COMMON_THREAD_CTX void ***thread_ctx;
 #else
 # define PHP_EVENT_COMMON_THREAD_CTX
 #endif
 	zend_fcall_info       *fci;
 	zend_fcall_info_cache *fcc;
 
-	PHP_EVENT_COMMON_THREAD_CTX;
+	PHP_EVENT_COMMON_THREAD_CTX
 } php_event_t;
 
 /* Represents EventConfig object */
 	zend_fcall_info       *fci_event;
 	zend_fcall_info_cache *fcc_event;
 
-	PHP_EVENT_COMMON_THREAD_CTX;
+	PHP_EVENT_COMMON_THREAD_CTX
 } php_event_bevent_t;
 
 /* Represents EventBuffer object */
 	zend_fcall_info       *fci_err;
 	zend_fcall_info_cache *fcc_err;
 
-	PHP_EVENT_COMMON_THREAD_CTX;
+	PHP_EVENT_COMMON_THREAD_CTX
 } php_event_listener_t;
 
 typedef struct _php_event_http_cb_t php_event_http_cb_t;
 	zend_fcall_info       *fci;
 	zend_fcall_info_cache *fcc;
 
-	PHP_EVENT_COMMON_THREAD_CTX;
+	PHP_EVENT_COMMON_THREAD_CTX
 };
 
 /* Represents EventHttp object */
 	/* Linked list of attached callbacks */
 	php_event_http_cb_t   *cb_head;
 
-	PHP_EVENT_COMMON_THREAD_CTX;
+	PHP_EVENT_COMMON_THREAD_CTX
 } php_event_http_t;
 
 /* Represents EventHttpConnection object */
 	zend_fcall_info       *fci_closecb;
 	zend_fcall_info_cache *fcc_closecb;
 	
-	PHP_EVENT_COMMON_THREAD_CTX;
+	PHP_EVENT_COMMON_THREAD_CTX
 } php_event_http_conn_t;
 
 typedef struct {
 	zend_fcall_info       *fci;
 	zend_fcall_info_cache *fcc;
 
-	PHP_EVENT_COMMON_THREAD_CTX;
+	PHP_EVENT_COMMON_THREAD_CTX
 } php_event_http_req_t;
 
 #endif/* HAVE_EVENT_EXTRA_LIB }}} */
     PHP_EVENT_SOCKETS_REQUIRED_NORET;                                          \
     RETURN_FALSE
 
-#ifdef PHP_WIN32
-# define PHP_EVENT_TSRMLS_FETCH_FROM_CTX(ctx) tsrm_ls = (void ***)ctx
-# define PHP_EVENT_TSRM_DECL void ***tsrm_ls;
+#if defined(PHP_WIN32)
+#if defined(ZTS)
+#  define PHP_EVENT_TSRMLS_FETCH_FROM_CTX(ctx) tsrm_ls = (void ***)ctx
+#  define PHP_EVENT_TSRM_DECL void ***tsrm_ls;
+# else
+#  define PHP_EVENT_TSRMLS_FETCH_FROM_CTX(ctx)
+#  define PHP_EVENT_TSRM_DECL
+# endif
 #else
 # define PHP_EVENT_TSRMLS_FETCH_FROM_CTX(ctx) TSRMLS_FETCH_FROM_CTX(ctx)
 # define PHP_EVENT_TSRM_DECL