From: Michael Wallner Date: Wed, 9 Mar 2005 13:34:36 +0000 (+0000) Subject: * cpp stuff X-Git-Tag: RELEASE_0_7_0~42 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=e93a92c530d8adb0e99682b458edcb05efc7db0d * cpp stuff --- diff --git a/http.c b/http.c index 155d0fe..43f1546 100644 --- a/http.c +++ b/http.c @@ -15,13 +15,20 @@ /* $Id$ */ -#define _WINSOCKAPI_ -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS #ifdef HAVE_CONFIG_H # include "config.h" #endif +#ifdef HTTP_HAVE_CURL +# ifdef PHP_WIN32 +# define _WINSOCKAPI_ +# include +# include +# endif +# include +#endif + #include "php.h" #include "php_ini.h" #include "snprintf.h" @@ -42,14 +49,6 @@ #endif #ifdef HTTP_HAVE_CURL - -# ifdef PHP_WIN32 -# include -# include -# endif - -# include - /* {{{ ARG_INFO */ # ifdef ZEND_BEGIN_ARG_INFO ZEND_BEGIN_ARG_INFO(http_request_info_ref_3, 0) diff --git a/http_api.c b/http_api.c index af42cd5..554c648 100644 --- a/http_api.c +++ b/http_api.c @@ -15,9 +15,6 @@ /* $Id$ */ -#define _WINSOCKAPI_ -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -25,6 +22,7 @@ #include #ifdef PHP_WIN32 +# define _WINSOCKAPI_ # include #elif defined(HAVE_NETDB_H) # include diff --git a/http_curl_api.c b/http_curl_api.c index 08d543d..b4a8077 100644 --- a/http_curl_api.c +++ b/http_curl_api.c @@ -21,7 +21,6 @@ #ifdef PHP_WIN32 # define _WINSOCKAPI_ -# define ZEND_INCLUDE_FULL_WINDOWS_HEADERS # include # include #endif diff --git a/http_functions.c b/http_functions.c index 2935626..1cffa17 100644 --- a/http_functions.c +++ b/http_functions.c @@ -15,9 +15,6 @@ /* $Id$ */ -#define _WINSOCKAPI_ -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -608,7 +605,7 @@ PHP_FUNCTION(http_split_response) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not parse HTTP response"); RETURN_FALSE; } - + array_init(return_value); add_index_zval(return_value, 0, zheaders); add_index_zval(return_value, 1, zbody); diff --git a/http_methods.c b/http_methods.c index 4953d27..1365fcf 100644 --- a/http_methods.c +++ b/http_methods.c @@ -15,9 +15,6 @@ /* $Id$ */ -#define _WINSOCKAPI_ -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - #ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/php_http.h b/php_http.h index e9d6616..1234f9b 100644 --- a/php_http.h +++ b/php_http.h @@ -55,7 +55,7 @@ typedef enum { HTTP_POST, } http_request_method; -#endif +#endif /* HTTP_HAVE _CURL */ PHP_METHOD(HTTPi, date); PHP_METHOD(HTTPi, absoluteURI); @@ -79,7 +79,7 @@ PHP_METHOD(HTTPi, get); PHP_METHOD(HTTPi, head); PHP_METHOD(HTTPi, postData); PHP_METHOD(HTTPi, postArray); -#endif +#endif /* HTTP_HAVE_CURL */ PHP_METHOD(HTTPi, authBasic); PHP_METHOD(HTTPi, authBasicCallback); @@ -166,12 +166,12 @@ PHP_FUNCTION(http_get); PHP_FUNCTION(http_head); PHP_FUNCTION(http_post_data); PHP_FUNCTION(http_post_array); -#endif +#endif /* HTTP_HAVE_CURL */ PHP_FUNCTION(http_auth_basic); PHP_FUNCTION(http_auth_basic_cb); #ifndef ZEND_ENGINE_2 PHP_FUNCTION(http_build_query); -#endif +#endif /* ZEND_ENGINE_2 */ PHP_FUNCTION(ob_httpetaghandler); PHP_MINIT_FUNCTION(http); @@ -196,7 +196,7 @@ ZEND_BEGIN_MODULE_GLOBALS(http) size_t size; } curlbuf; zend_llist to_free; -#endif +#endif /* HTTP_HAVE_CURL */ ZEND_END_MODULE_GLOBALS(http) #endif /* PHP_HTTP_H */