- attempt to fix gcc-2.95 build by using less HTTP_HAVE_$EXT magic
authorMichael Wallner <mike@php.net>
Sun, 11 Jun 2006 16:40:41 +0000 (16:40 +0000)
committerMichael Wallner <mike@php.net>
Sun, 11 Jun 2006 16:40:41 +0000 (16:40 +0000)
http.c
http_functions.c
http_message_object.c
http_querystring_api.c
http_querystring_object.c
package2.xml
php_http.h
php_http_cache_api.h
php_http_querystring_api.h
php_http_querystring_object.h

diff --git a/http.c b/http.c
index 1dba9c6a63d32470daf2bd91ff6acdb7f9971a3a..348940b6bad82e654832dd159ade4b6f48aef538 100644 (file)
--- a/http.c
+++ b/http.c
@@ -137,16 +137,16 @@ PHP_MINFO_FUNCTION(http);
 /* {{{ http_module_dep */
 #if ZEND_EXTENSION_API_NO >= 220050617
 static zend_module_dep http_module_deps[] = {
-#      if HTTP_HAVE_EXT(SPL)
+#      ifdef HTTP_HAVE_SPL
        ZEND_MOD_REQUIRED("spl")
 #      endif
-#      if HTTP_HAVE_EXT_HASH
+#      ifdef HTTP_HAVE_HASH
        ZEND_MOD_REQUIRED("hash")
 #      endif
-#      if HTTP_HAVE_EXT(SESSION)
+#      ifdef HTTP_HAVE_SESSION
        ZEND_MOD_REQUIRED("session")
 #      endif
-#      if HTTP_HAVE_EXT(ICONV)
+#      ifdef HTTP_HAVE_ICONV
        ZEND_MOD_REQUIRED("iconv")
 #      endif
        {NULL, NULL, NULL, 0}
index 930908ded52d426721b3f64f1d6387292854697e..bf1e19393557e10c0105bec88a384c755ab7b2f7 100644 (file)
@@ -21,7 +21,7 @@
 #include "ext/standard/php_string.h"
 #include "zend_operators.h"
 
-#if HTTP_HAVE_EXT(SESSION)
+#ifdef HTTP_HAVE_SESSION
 #      include "ext/session/php_session.h"
 #endif
 
@@ -728,7 +728,7 @@ PHP_FUNCTION(http_redirect)
                RETURN_FALSE;
        }
 
-#if HTTP_HAVE_EXT(SESSION)
+#ifdef HTTP_HAVE_SESSION
        /* append session info */
        if (session) {
                if (!params) {
index 56b1a1e9c9566514b091a6aaf6fb619f7d27b439..a1b3141817d699faddc5d8b270f8cf92643a1d79 100644 (file)
@@ -33,7 +33,7 @@
 #include "php_http_request_api.h"
 #include "php_http_request_object.h"
 
-#if HTTP_HAVE_EXT(SPL) && !defined(WONKY)
+#if defined(HTTP_HAVE_SPL) && !defined(WONKY)
 /* SPL doesn't install its headers */
 extern PHPAPI zend_class_entry *spl_ce_Countable;
 #endif
@@ -192,7 +192,7 @@ PHP_MINIT_FUNCTION(http_message_object)
        HTTP_REGISTER_CLASS_EX(HttpMessage, http_message_object, NULL, 0);
        
 #ifndef WONKY
-#      if HTTP_HAVE_EXT(SPL)
+#      ifdef HTTP_HAVE_SPL
        zend_class_implements(http_message_object_ce TSRMLS_CC, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator);
 #      else
        zend_class_implements(http_message_object_ce TSRMLS_CC, 2, zend_ce_serializable, zend_ce_iterator);
index 03fe7266618b554145dba6a5004a7484d115edc0..76af3482550572d57f5d33748c1706191b5be48b 100644 (file)
@@ -16,7 +16,7 @@
 #include "php_http.h"
 
 #include "php_variables.h"
-#if HTTP_HAVE_EXT(ICONV)
+#ifdef HTTP_HAVE_ICONV
 #      undef PHP_ATOM_INC
 #      include "ext/iconv/php_iconv.h"
 #      include "ext/standard/url.h"
@@ -38,7 +38,7 @@ static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type,
 static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRMLS_DC);
 
 
-#if HTTP_HAVE_EXT(ICONV)
+#ifdef HTTP_HAVE_ICONV
 PHP_HTTP_API int _http_querystring_xlate(zval *array, zval *param, const char *ie, const char *oe TSRMLS_DC)
 {
        HashPosition pos;
index 580ae6bf38d9639aa277a226c2fd9339248a7535..cdbabbbaaf5fd18f846dd3beb785f1fb7f334a89 100644 (file)
@@ -61,7 +61,7 @@ HTTP_BEGIN_ARGS(__getter, 1)
        HTTP_ARG_VAL(delete, 0)
 HTTP_END_ARGS;
 
-#if HTTP_HAVE_EXT(ICONV)
+#ifdef HTTP_HAVE_ICONV
 HTTP_BEGIN_ARGS(xlate, 2)
        HTTP_ARG_VAL(from_encoding, 0)
        HTTP_ARG_VAL(to_encoding, 0)
@@ -95,7 +95,7 @@ zend_function_entry http_querystring_object_fe[] = {
 #ifndef WONKY
        HTTP_QUERYSTRING_ME(singleton, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
 #endif
-#if HTTP_HAVE_EXT(ICONV)
+#ifdef HTTP_HAVE_ICONV
        HTTP_QUERYSTRING_ME(xlate, ZEND_ACC_PUBLIC)
 #endif
        
@@ -431,7 +431,7 @@ HTTP_QUERYSTRING_GETTER(getArray, IS_ARRAY);
 HTTP_QUERYSTRING_GETTER(getObject, IS_OBJECT);
 /* }}} */
 
-#if HTTP_HAVE_EXT(ICONV)
+#ifdef HTTP_HAVE_ICONV
 /* {{{ proto bool HttpQueryString::xlate(string ie, string oe)
  *
  * Converts the query string from the source encoding ie to the target encoding oe.
index be45841ea0bc4c3769808c0c1ebe4d33c79289ab..1309fdd4063dfdd0523517cac0d7870f95408be4 100644 (file)
@@ -30,7 +30,7 @@ support. Parallel requests are available for PHP 5 and greater.
  </lead>
  <date>2006-00-00</date>
  <version>
-  <release>1.0.0</release>
+  <release>1.0.1</release>
   <api>1.0.0</api>
  </version>
  <stability>
@@ -39,12 +39,7 @@ support. Parallel requests are available for PHP 5 and greater.
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-+ Added --with[out]-http-shared-deps configure option (dependencies on shared extensions)
-+ Added INI entries: http.log.not_found, http.send.not_found_404
-+ Added HttpMessage::guessContentType()
-* Fixed build on Debian systems where access to Curl_* functions is prohibited
-* Fixed empty Cache-Control header if not customly set with HttpResponse
-* Reset Content-Disposition and Content-Type if file is not found by http_send_file() etc
+* Fixed build with gcc-2.95
 ]]></notes>
  <contents>
   <dir name="/">
index c3ef9f84dcd1bbadfe77089f77c7baa462a1b06e..431e7fb033847f5ca007e49a4b61280e0b793f27 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef PHP_EXT_HTTP_H
 #define PHP_EXT_HTTP_H
 
-#define PHP_EXT_HTTP_VERSION "1.0.0"
+#define PHP_EXT_HTTP_VERSION "1.0.1dev"
 
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
@@ -144,7 +144,21 @@ ZEND_EXTERN_MODULE_GLOBALS(http);
 #      define HTTP_G (&http_globals)
 #endif
 
-#define HTTP_HAVE_EXT(EXT) ((defined(HAVE_##EXT) || defined(HAVE_PHP_##EXT) || defined(HAVE_##EXT##_EXT)) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_##EXT)))
+#if defined(HAVE_ICONV) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_ICONV))
+#      define HTTP_HAVE_ICONV
+#endif
+
+#if defined(HAVE_PHP_SESSION) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_SESSION))
+#      define HTTP_HAVE_SESSION
+#endif
+
+#if defined(HAVE_HASH_EXT) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_HASH) && defined(HTTP_HAVE_PHP_HASH_H))
+#      define HTTP_HAVE_HASH
+#endif
+
+#if defined(HAVE_SPL)
+#      define HTTP_HAVE_SPL
+#endif
 
 PHP_FUNCTION(http_test);
 PHP_FUNCTION(http_date);
index 3c2e7834321ff727d8952c33f57fdf002b520342..dc9b515bd6897f4dde680a1dc31d07850164347a 100644 (file)
 #include "ext/standard/sha1.h"
 #include "ext/standard/md5.h"
 
-#if defined(HTTP_HAVE_PHP_HASH_H) && HTTP_HAVE_EXT(HASH)
-#      define HTTP_HAVE_EXT_HASH 1
+#ifdef HTTP_HAVE_HASH
 #      include "php_hash.h"
-#else
-#      define HTTP_HAVE_EXT_HASH 0
 #endif
 
 #define http_etag_digest(d, l) _http_etag_digest((d), (l))
@@ -51,7 +48,7 @@ static inline void *_http_etag_init(TSRMLS_D)
        void *ctx = NULL;
        char *mode = HTTP_G->etag.mode;
        
-#if HTTP_HAVE_EXT_HASH
+#ifdef HTTP_HAVE_HASH
        php_hash_ops *eho = NULL;
        
        if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) {
@@ -77,7 +74,7 @@ static inline char *_http_etag_finish(void *ctx TSRMLS_DC)
        unsigned char digest[128] = {0};
        char *etag = NULL, *mode = HTTP_G->etag.mode;
        
-#if HTTP_HAVE_EXT_HASH
+#ifdef HTTP_HAVE_HASH
        php_hash_ops *eho = NULL;
        
        if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) {
@@ -104,7 +101,7 @@ static inline char *_http_etag_finish(void *ctx TSRMLS_DC)
 static inline void _http_etag_update(void *ctx, const char *data_ptr, size_t data_len TSRMLS_DC)
 {
        char *mode = HTTP_G->etag.mode;
-#if HTTP_HAVE_EXT_HASH
+#ifdef HTTP_HAVE_HASH
        php_hash_ops *eho = NULL;
        
        if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) {
index 60b63bc7a208e70562e9338e80711f933062f69b..2960b1d6efa0b936bc18dedc422f156e91a403bf 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef PHP_HTTP_QUERYSTRING_API_H
 #define PHP_HTTP_QUERYSTRING_API_H
 
-#if HTTP_HAVE_EXT(ICONV)
+#ifdef HTTP_HAVE_ICONV
 #define http_querystring_xlate(a, p, ie, oe) _http_querystring_xlate((a), (p), (ie), (oe) TSRMLS_CC)
 PHP_HTTP_API int _http_querystring_xlate(zval *array, zval *param, const char *ie, const char *oe TSRMLS_DC);
 #endif
index 76f251344e129011878424a5114c9288d04d9fd4..63a47d81ba33d7dd1fd923b6581495887334f93b 100644 (file)
@@ -50,7 +50,7 @@ PHP_METHOD(HttpQueryString, getFloat);
 PHP_METHOD(HttpQueryString, getString);
 PHP_METHOD(HttpQueryString, getArray);
 PHP_METHOD(HttpQueryString, getObject);
-#if HTTP_HAVE_EXT(ICONV)
+#ifdef HTTP_HAVE_ICONV
 PHP_METHOD(HttpQueryString, xlate);
 #endif
 #ifndef WONKY