diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-07 11:05:07 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-07 11:05:07 +0200 |
commit | d1ac7e3ab1bf3cf639ddbd63ed3824e8bb9fc32f (patch) | |
tree | 9d8bd3f15db87e3fe69a31573bae1386e27d67c5 /ext | |
parent | 8e05c4449673c8fd7bf3e1d3f5ddf4689ddd0bdb (diff) | |
download | php-git-d1ac7e3ab1bf3cf639ddbd63ed3824e8bb9fc32f.tar.gz |
Remove some unnecessary HAVE_EXTNAME guards
A recurring pattern in old extension: Putting the whole source
code behind HAVE_EXTNAME. This is pointless, as the code is only
compiled if the extension is enabled.
This removes a couple of them, but not all.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/curl/curl_file.c | 3 | ||||
-rw-r--r-- | ext/curl/interface.c | 4 | ||||
-rw-r--r-- | ext/curl/multi.c | 4 | ||||
-rw-r--r-- | ext/curl/php_curl.h | 13 | ||||
-rw-r--r-- | ext/curl/share.c | 4 | ||||
-rw-r--r-- | ext/exif/exif.c | 4 | ||||
-rw-r--r-- | ext/exif/php_exif.h | 4 | ||||
-rw-r--r-- | ext/ftp/ftp.c | 4 | ||||
-rw-r--r-- | ext/ftp/php_ftp.h | 10 |
9 files changed, 2 insertions, 48 deletions
diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c index 4a2b8328b9..3888840fd1 100644 --- a/ext/curl/curl_file.c +++ b/ext/curl/curl_file.c @@ -23,7 +23,6 @@ #include "Zend/zend_interfaces.h" #include "php_curl.h" #include "curl_file_arginfo.h" -#ifdef HAVE_CURL PHP_CURL_API zend_class_entry *curl_CURLFile_class; @@ -132,5 +131,3 @@ void curlfile_register_class(void) zend_declare_property_string(curl_CURLFile_class, "mime", sizeof("mime")-1, "", ZEND_ACC_PUBLIC); zend_declare_property_string(curl_CURLFile_class, "postname", sizeof("postname")-1, "", ZEND_ACC_PUBLIC); } - -#endif diff --git a/ext/curl/interface.c b/ext/curl/interface.c index a529ef8e73..906b1c4a0b 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -24,8 +24,6 @@ #include "Zend/zend_interfaces.h" #include "Zend/zend_exceptions.h" -#ifdef HAVE_CURL - #include <stdio.h> #include <string.h> @@ -3537,5 +3535,3 @@ PHP_FUNCTION(curl_pause) RETURN_LONG(curl_easy_pause(ch->cp, bitmask)); } /* }}} */ - -#endif /* HAVE_CURL */ diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 55d7f8e4d5..954575d54f 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -23,8 +23,6 @@ #include "php.h" #include "Zend/zend_interfaces.h" -#ifdef HAVE_CURL - #include "php_curl.h" #include <curl/curl.h> @@ -599,5 +597,3 @@ void curl_multi_register_class(const zend_function_entry *method_entries) { curl_multi_handlers.clone_obj = NULL; curl_multi_handlers.cast_object = curl_cast_object; } - -#endif diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index 5022f69d21..2a195b082b 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -21,13 +21,6 @@ #include "php.h" #include "zend_smart_str.h" -#ifdef COMPILE_DL_CURL -#undef HAVE_CURL -#define HAVE_CURL 1 -#endif - -#ifdef HAVE_CURL - #define PHP_CURL_DEBUG 0 #ifdef PHP_WIN32 @@ -45,7 +38,7 @@ #include <curl/multi.h> extern zend_module_entry curl_module_entry; -#define curl_module_ptr &curl_module_entry +#define phpext_curl_ptr &curl_module_entry #define CURLOPT_RETURNTRANSFER 19913 #define CURLOPT_BINARYTRANSFER 19914 /* For Backward compatibility */ @@ -180,8 +173,4 @@ int curl_cast_object(zend_object *obj, zval *result, int type); PHP_CURL_API extern zend_class_entry *curl_CURLFile_class; -#else -#define curl_module_ptr NULL -#endif /* HAVE_CURL */ -#define phpext_curl_ptr curl_module_ptr #endif /* _PHP_CURL_H */ diff --git a/ext/curl/share.c b/ext/curl/share.c index 407e14cdcf..d7eb7be56a 100644 --- a/ext/curl/share.c +++ b/ext/curl/share.c @@ -23,8 +23,6 @@ #include "php.h" #include "Zend/zend_interfaces.h" -#ifdef HAVE_CURL - #include "php_curl.h" #include <curl/curl.h> @@ -179,5 +177,3 @@ void curl_share_register_class(const zend_function_entry *method_entries) { curl_share_handlers.get_constructor = curl_share_get_constructor; curl_share_handlers.clone_obj = NULL; } - -#endif diff --git a/ext/exif/exif.c b/ext/exif/exif.c index a75b7db57a..b2852628ba 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -22,8 +22,6 @@ #include "php.h" #include "ext/standard/file.h" -#ifdef HAVE_EXIF - /* When EXIF_DEBUG is defined the module generates a lot of debug messages * that help understanding what is going on. This can and should be used * while extending the module as it shows if you are at the right position. @@ -4791,5 +4789,3 @@ PHP_FUNCTION(exif_imagetype) } } /* }}} */ - -#endif diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h index 466b02645f..fbc91a0f85 100644 --- a/ext/exif/php_exif.h +++ b/ext/exif/php_exif.h @@ -15,12 +15,8 @@ +----------------------------------------------------------------------+ */ -#ifdef HAVE_EXIF - #include "php_version.h" #define PHP_EXIF_VERSION PHP_VERSION extern zend_module_entry exif_module_entry; #define phpext_exif_ptr &exif_module_entry - -#endif diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 3defd3d506..7ce3386c57 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -21,8 +21,6 @@ #include "php.h" -#ifdef HAVE_FTP - #include <stdio.h> #include <ctype.h> #include <stdlib.h> @@ -2266,5 +2264,3 @@ bail: return PHP_FTP_FAILED; } /* }}} */ - -#endif /* HAVE_FTP */ diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h index 60eba04adf..ac0bef5fd7 100644 --- a/ext/ftp/php_ftp.h +++ b/ext/ftp/php_ftp.h @@ -18,10 +18,8 @@ #ifndef _INCLUDED_FTP_H #define _INCLUDED_FTP_H -#ifdef HAVE_FTP - extern zend_module_entry php_ftp_module_entry; -#define php_ftp_module_ptr &php_ftp_module_entry +#define phpext_ftp_ptr &php_ftp_module_entry #include "php_version.h" #define PHP_FTP_VERSION PHP_VERSION @@ -34,10 +32,4 @@ extern zend_module_entry php_ftp_module_entry; PHP_MINIT_FUNCTION(ftp); PHP_MINFO_FUNCTION(ftp); -#define phpext_ftp_ptr php_ftp_module_ptr - -#else -#define php_ftp_module_ptr NULL -#endif /* HAVE_FTP */ - #endif |