* attempt to fix snap-build
authorMichael Wallner <mike@php.net>
Wed, 9 Feb 2005 10:59:36 +0000 (10:59 +0000)
committerMichael Wallner <mike@php.net>
Wed, 9 Feb 2005 10:59:36 +0000 (10:59 +0000)
config.m4
config.w32
http.c
http_api.c
php_http.h
php_http_api.h

index f50162716ff0d6b79fe54857858f0260409e4cd6..ae3f25812c96bb6ccd993865a9f2abb8194da6cd 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -47,7 +47,7 @@ dnl ----
 
                PHP_CHECK_LIBRARY(curl,curl_easy_init,
                [
-                       AC_DEFINE(HAVE_CURL,1,[Have CURL easy support])
+                       AC_DEFINE(HTTP_HAVE_CURL,1,[Have CURL easy support])
                ],[
                        AC_MSG_ERROR(There is something wrong with libcurl. Please check config.log for more information.)
                ],[
index d06aa3f6ca2097bc67f7b16a73f07f18ca529468..e3401b516029aa6837668ee13f763ee6a2b72482 100644 (file)
@@ -12,7 +12,7 @@ if (PHP_HTTP != "no") {
             CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
             CHECK_LIB("zlib.lib", "http", PHP_HTTP) &&
             CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
-        AC_DEFINE('HAVE_CURL', 1, 'Have CURL library');
+        AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library");
     } else {
         WARNING("curl convenience functions not enabled; libraries and headers not found");
     }
diff --git a/http.c b/http.c
index 56ae91d1024f3a3c3aa5292df29393aa85b32bd3..74e2968ec7839e831796611a4a0f807a6e21e0ba 100644 (file)
--- a/http.c
+++ b/http.c
 #include "config.h"
 #endif
 
-#if defined(HAVE_CURL) && HAVE_CURL
-#      ifdef PHP_WIN32
-#      include <winsock2.h>
-#      include <sys/types.h>
-#      endif
-#include <curl/curl.h>
-#endif
-
 #include "php.h"
 #include "snprintf.h"
 #include "ext/standard/info.h"
 #include "php_http.h"
 #include "php_http_api.h"
 
+#ifdef HTTP_HAVE_CURL
+
+#ifdef PHP_WIN32
+#include <winsock2.h>
+#include <sys/types.h>
+#endif
+
+#include <curl/curl.h>
+#endif
+
 ZEND_DECLARE_MODULE_GLOBALS(http)
 
 #ifdef COMPILE_DL_HTTP
@@ -65,7 +67,7 @@ function_entry http_functions[] = {
        PHP_FE(http_send_stream, NULL)
        PHP_FE(http_chunked_decode, NULL)
        PHP_FE(http_split_response, NULL)
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
        PHP_FE(http_get, NULL)
        PHP_FE(http_head, NULL)
        PHP_FE(http_post_data, NULL)
@@ -677,7 +679,7 @@ PHP_FUNCTION(http_split_response)
 /* }}} */
 
 /* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
 
 /* {{{ proto string http_get(string url[, array options[, array &info]])
  *
@@ -948,7 +950,7 @@ static void php_http_init_globals(zend_http_globals *http_globals)
        http_globals->ctype = NULL;
        http_globals->etag  = NULL;
        http_globals->lmod  = 0;
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
        http_globals->curlbuf.body.data = NULL;
        http_globals->curlbuf.body.used = 0;
        http_globals->curlbuf.body.free = 0;
@@ -963,7 +965,7 @@ static void php_http_init_globals(zend_http_globals *http_globals)
 PHP_MINIT_FUNCTION(http)
 {
        ZEND_INIT_MODULE_GLOBALS(http, php_http_init_globals, NULL);
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
        REGISTER_LONG_CONSTANT("HTTP_AUTH_BASIC", CURLAUTH_BASIC, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("HTTP_AUTH_DIGEST", CURLAUTH_DIGEST, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("HTTP_AUTH_NTLM", CURLAUTH_NTLM, CONST_CS | CONST_PERSISTENT);
@@ -981,7 +983,7 @@ PHP_RSHUTDOWN_FUNCTION(http)
        if (HTTP_G(etag)) {
                efree(HTTP_G(etag));
        }
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
        if (HTTP_G(curlbuf).body.data) {
                efree(HTTP_G(curlbuf).body.data);
        }
@@ -1000,7 +1002,7 @@ PHP_MINFO_FUNCTION(http)
        php_info_print_table_header(2, "Extended HTTP support", "enabled");
        php_info_print_table_row(2, "Version:", PHP_EXT_HTTP_VERSION);
        php_info_print_table_row(2, "cURL convenience functions:",
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
                        "enabled"
 #else
                        "disabled"
index 059228d105a32c5585dc9af4c639a8b07d008a0f..064386e25f5fa11cc4bca54d75acea04d48ed92e 100644 (file)
 
 #include <ctype.h>
 
-#if defined(HAVE_CURL) && HAVE_CURL
-#      ifdef PHP_WIN32
-#      include <winsock2.h>
-#      include <sys/types.h>
-#      endif
-#include <curl/curl.h>
-#include <curl/easy.h>
-#endif
-
 #include "php.h"
 #include "php_version.h"
 #include "php_streams.h"
 #include "php_http.h"
 #include "php_http_api.h"
 
+#ifdef HTTP_HAVE_CURL
+
+#ifdef PHP_WIN32
+#include <winsock2.h>
+#include <sys/types.h>
+#endif
+
+#include <curl/curl.h>
+#include <curl/easy.h>
+#endif
+
+
 ZEND_DECLARE_MODULE_GLOBALS(http)
 
 /* {{{ day/month names */
@@ -142,7 +145,7 @@ static int check_month(char *month);
 static int check_tzone(char *tzone);
 
 /* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
 #define http_curl_initbuf(m) _http_curl_initbuf((m) TSRMLS_CC)
 static inline void _http_curl_initbuf(http_curlbuf_member member TSRMLS_DC);
 #define http_curl_freebuf(m) _http_curl_freebuf((m) TSRMLS_CC)
@@ -297,7 +300,7 @@ static STATUS _http_send_chunk(const void *data, const size_t begin,
 /* }}} */
 
 /* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
 
 /* {{{ static inline void http_curl_initbuf(http_curlbuf_member) */
 static inline void _http_curl_initbuf(http_curlbuf_member member TSRMLS_DC)
@@ -1746,7 +1749,7 @@ PHP_HTTP_API void _http_split_response(const zval *zresponse, zval *zheaders,
 /* }}} */
 
 /* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
 
 /* {{{ STATUS http_get(char *, HashTable *, HashTable *, char **, size_t *) */
 PHP_HTTP_API STATUS _http_get(const char *URL, HashTable *options,
index 2f2b7eef4ce732567d91ee29cd02aa99b6c72354..4ed736c0526ce341b457714d57225cd32b04a8a0 100644 (file)
@@ -52,7 +52,7 @@ PHP_FUNCTION(http_send_file);
 PHP_FUNCTION(http_send_stream);
 PHP_FUNCTION(http_chunked_decode);
 PHP_FUNCTION(http_split_response);
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
 PHP_FUNCTION(http_get);
 PHP_FUNCTION(http_head);
 PHP_FUNCTION(http_post_data);
@@ -72,7 +72,7 @@ ZEND_BEGIN_MODULE_GLOBALS(http)
        char *ctype;
        char *etag;
        time_t lmod;
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
        struct {
                struct {
                        char *data;
index 34a01597587f25aad7ec29de69c2de536ce28833..56cf5416a0ac9c80a208e6d2f7096439d4c8066b 100644 (file)
@@ -52,7 +52,7 @@ typedef enum {
 #define HTTP_SERVER_VARS Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])
 
 /* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
 
 /* CURL buffer size */
 #define HTTP_CURLBUF_BODYSIZE 16384
@@ -149,7 +149,7 @@ PHP_HTTP_API STATUS _http_chunked_decode(const char *encoded, const size_t encod
 PHP_HTTP_API void _http_split_response(const zval *zresponse, zval *zheaders, zval *zbody TSRMLS_DC);
 
 /* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
 
 #define http_get(u, o, i, d, l) _http_get((u), (o), (i), (d), (l) TSRMLS_CC)
 PHP_HTTP_API STATUS _http_get(const char *URL, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC);