]> granicus.if.org Git - php/commitdiff
Move macro back to .c file
authorGustavo Lopes <glopes@nebm.ist.utl.pt>
Sat, 2 Feb 2013 17:32:38 +0000 (18:32 +0100)
committerGustavo Lopes <glopes@nebm.ist.utl.pt>
Sat, 2 Feb 2013 17:32:38 +0000 (18:32 +0100)
Because it depends on a static function on that .c file.

ext/sockets/php_sockets.h
ext/sockets/sockets.c

index 3762e026aa516846917b16b4685ef102a130ba14..fabc9c4c3e74aa90eec4c92a2d1cf865fea2ed84 100644 (file)
@@ -64,14 +64,6 @@ PHP_SOCKETS_API int php_sockets_le_socket(void);
 
 #define php_sockets_le_socket_name "Socket"
 
-#define PHP_SOCKET_ERROR(socket, msg, errn) \
-               do { \
-                       int _err = (errn); /* save value to avoid repeated calls to WSAGetLastError() on Windows */ \
-                       (socket)->error = _err; \
-                       SOCKETS_G(last_error) = _err; \
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s [%d]: %s", msg, _err, php_strerror(_err TSRMLS_CC)); \
-               } while (0)
-
 ZEND_BEGIN_MODULE_GLOBALS(sockets)
        int last_error;
        char *strerror_buf;
index c6c5477967c9290be97e02a446b2ef77449fab0c..06bd0ec6b4fec154b42858d2727259edd664e831 100644 (file)
@@ -114,6 +114,14 @@ static PHP_GINIT_FUNCTION(sockets);
 
 static char *php_strerror(int error TSRMLS_DC);
 
+#define PHP_SOCKET_ERROR(socket, msg, errn) \
+               do { \
+                       int _err = (errn); /* save value to avoid repeated calls to WSAGetLastError() on Windows */ \
+                       (socket)->error = _err; \
+                       SOCKETS_G(last_error) = _err; \
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s [%d]: %s", msg, _err, php_strerror(_err TSRMLS_CC)); \
+               } while (0)
+
 #define PHP_NORMAL_READ 0x0001
 #define PHP_BINARY_READ 0x0002