]> granicus.if.org Git - php/commitdiff
Add missing #ifdef for curl version that does not have FTP_FILEMETHOD or IPRESOLVE...
authorBrian Shire <shire@php.net>
Fri, 8 May 2009 03:32:54 +0000 (03:32 +0000)
committerBrian Shire <shire@php.net>
Fri, 8 May 2009 03:32:54 +0000 (03:32 +0000)
ext/curl/interface.c

index 807d0a96abd7666e74daee6fbe419b4708eea443..1c5263eaa32ab033dd6220a36da103cfb14fdab2 100644 (file)
@@ -448,10 +448,12 @@ PHP_MINIT_FUNCTION(curl)
           of options and which version they were introduced */
 
        /* Constants for curl_setopt() */
+#if LIBCURL_VERSION_NUM > 0x070a07 /* CURLOPT_IPRESOLVE is available since curl 7.10.8 */
        REGISTER_CURL_CONSTANT(CURLOPT_IPRESOLVE);
        REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_WHATEVER);
        REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V4);
        REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V6);
+#endif
        REGISTER_CURL_CONSTANT(CURLOPT_DNS_USE_GLOBAL_CACHE);
        REGISTER_CURL_CONSTANT(CURLOPT_DNS_CACHE_TIMEOUT);
        REGISTER_CURL_CONSTANT(CURLOPT_PORT);
@@ -1541,8 +1543,12 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
                case CURLOPT_REDIR_PROTOCOLS:
                case CURLOPT_PROTOCOLS:
 #endif
+#if LIBCURL_VERSION_NUM > 0x070a07 /* CURLOPT_IPRESOLVE is available since curl 7.10.8 */
                case CURLOPT_IPRESOLVE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070f01
                case CURLOPT_FTP_FILEMETHOD:
+#endif
                        convert_to_long_ex(zvalue);
                        error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
                        break;