diff --git a/Zend/zend_API.c b/Zend/zend_API.c index bc6401c8ca28e..f702270dbc117 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3346,7 +3346,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */ void module_registry_unload(const zend_module_entry *module) { -#if HAVE_LIBDL +#ifdef HAVE_LIBDL if (!getenv("ZEND_DONT_UNLOAD_MODULES")) { DL_UNLOAD(module->handle); } diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h index acfb5c46c60e0..e7889777713ca 100644 --- a/Zend/zend_virtual_cwd.h +++ b/Zend/zend_virtual_cwd.h @@ -32,12 +32,12 @@ #include #include -#if HAVE_SYS_PARAM_H +#ifdef HAVE_SYS_PARAM_H # include #endif #ifndef MAXPATHLEN -# if _WIN32 +# ifdef _WIN32 # include "win32/ioutil.h" # define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN # elif PATH_MAX diff --git a/ext/date/php_date.c b/ext/date/php_date.c index d6a04755cf85d..cf48188ea8a17 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2384,7 +2384,7 @@ static void php_date_set_time_fraction(timelib_time *time, int microsecond) static void php_date_get_current_time_with_fraction(time_t *sec, suseconds_t *usec) { -#if HAVE_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY struct timeval tp = {0}; /* For setting microsecond */ gettimeofday(&tp, NULL); diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c index 7fa995b7bd21d..bd76ecfdd0aef 100644 --- a/ext/dba/libflatfile/flatfile.c +++ b/ext/dba/libflatfile/flatfile.c @@ -29,7 +29,7 @@ #include #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index bb00b98fa4a14..c5467396d4bfe 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -26,7 +26,7 @@ #include #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif diff --git a/ext/dom/html_document.c b/ext/dom/html_document.c index 9734ab863b6cd..a7f6f957adadc 100644 --- a/ext/dom/html_document.c +++ b/ext/dom/html_document.c @@ -1114,7 +1114,7 @@ PHP_METHOD(Dom_HTMLDocument, createFromFile) xmlFree(converted); lxml_doc->URL = new_buffer; } else { -#if PHP_WIN32 +#ifdef PHP_WIN32 converted = php_dom_libxml_fix_file_path(converted); #endif lxml_doc->URL = converted; diff --git a/ext/dom/xml_document.c b/ext/dom/xml_document.c index c5ff51943e6f7..9844137d85c57 100644 --- a/ext/dom/xml_document.c +++ b/ext/dom/xml_document.c @@ -101,7 +101,7 @@ PHP_METHOD(Dom_XMLDocument, createEmpty) zend_argument_value_error(2, "is not a valid document encoding"); RETURN_THROWS(); } - + xmlDocPtr lxml_doc = xmlNewDoc((const xmlChar *) version); if (UNEXPECTED(lxml_doc == NULL)) { goto oom; @@ -197,7 +197,7 @@ static void load_from_helper(INTERNAL_FUNCTION_PARAMETERS, int mode) if (!php_is_stream_path((char *) lxml_doc->URL)) { /* Check for "file:/" instead of "file://" because of libxml2 quirk */ if (strncmp((const char *) lxml_doc->URL, "file:/", sizeof("file:/") - 1) != 0) { -#if PHP_WIN32 +#ifdef PHP_WIN32 xmlChar *buffer = xmlStrdup((const xmlChar *) "file:///"); #else xmlChar *buffer = xmlStrdup((const xmlChar *) "file://"); @@ -212,7 +212,7 @@ static void load_from_helper(INTERNAL_FUNCTION_PARAMETERS, int mode) } } } else { -#if PHP_WIN32 +#ifdef PHP_WIN32 lxml_doc->URL = php_dom_libxml_fix_file_path(BAD_CAST lxml_doc->URL); #endif } diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 863f9e9973a13..8d45b2ae41b61 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -962,7 +962,7 @@ static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf) return SUCCESS; } -#if ZEND_WIN32 +#ifdef ZEND_WIN32 static accel_time_t zend_get_file_handle_timestamp_win(zend_file_handle *file_handle, size_t *size) { static unsigned __int64 utc_base = 0; @@ -2177,7 +2177,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) HANDLE_UNBLOCK_INTERRUPTIONS(); } else { -#if !ZEND_WIN32 +#ifndef ZEND_WIN32 ZCSG(hits)++; /* TBFixed: may lose one hit */ persistent_script->dynamic_members.hits++; /* see above */ #else diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 6fed5af22a8d7..c23a3a4621724 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -36,7 +36,7 @@ /* 8 - Standalone Open Source Zend OPcache */ #define ACCELERATOR_API_NO 8 -#if ZEND_WIN32 +#ifdef ZEND_WIN32 # include "zend_config.w32.h" #else #include "zend_config.h" @@ -44,7 +44,7 @@ # include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include "unistd.h" #endif @@ -97,7 +97,7 @@ extern int lock_file; # define ENABLE_FILE_CACHE_FALLBACK 0 #endif -#if ZEND_WIN32 +#ifdef ZEND_WIN32 typedef unsigned __int64 accel_time_t; #else typedef time_t accel_time_t; diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 9f2c6ee21af6f..75bc37cdf7215 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -691,7 +691,7 @@ static bool zend_may_be_dynamic_property(zend_class_entry *ce, zend_string *memb # pragma clang diagnostic pop #endif -#if _WIN32 +#ifdef _WIN32 # include #else # include @@ -3246,7 +3246,7 @@ ZEND_EXT_API void zend_jit_unprotect(void) fprintf(stderr, "mprotect() failed [%d] %s\n", errno, strerror(errno)); } } -#elif _WIN32 +#elif defined(_WIN32) if (!(JIT_G(debug) & (ZEND_JIT_DEBUG_GDB|ZEND_JIT_DEBUG_PERF_DUMP))) { DWORD old, new; #ifdef ZTS @@ -3277,7 +3277,7 @@ ZEND_EXT_API void zend_jit_protect(void) fprintf(stderr, "mprotect() failed [%d] %s\n", errno, strerror(errno)); } } -#elif _WIN32 +#elif defined(_WIN32) if (!(JIT_G(debug) & (ZEND_JIT_DEBUG_GDB|ZEND_JIT_DEBUG_PERF_DUMP))) { DWORD old; @@ -3520,7 +3520,7 @@ ZEND_EXT_API void zend_jit_startup(void *buf, size_t size, bool reattached) fprintf(stderr, "mprotect() failed [%d] %s\n", errno, strerror(errno)); } } -#elif _WIN32 +#elif defined(_WIN32) if (JIT_G(debug) & (ZEND_JIT_DEBUG_GDB|ZEND_JIT_DEBUG_PERF_DUMP)) { DWORD old; diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index d1b7b2e43f316..302f039d06bdc 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -3125,7 +3125,7 @@ static void zend_jit_calc_trace_prologue_size(void) zend_jit_trace_prologue_size = size; } -#if !ZEND_WIN32 && !defined(IR_TARGET_AARCH64) +#if !defined(ZEND_WIN32) && !defined(IR_TARGET_AARCH64) static uintptr_t zend_jit_hybrid_vm_sp_adj = 0; typedef struct _Unwind_Context _Unwind_Context; @@ -3239,7 +3239,7 @@ static void zend_jit_setup(void) zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: offset >= size"); } } while(0); -# elif ZEND_WIN32 +# elif defined(ZEND_WIN32) tsrm_tls_index = _tls_index * sizeof(void*); /* To find offset of "_tsrm_ls_cache" in TLS segment we perform a linear scan of local TLS memory */ @@ -3339,7 +3339,7 @@ static void zend_jit_setup(void) # endif #endif -#if !ZEND_WIN32 && !defined(IR_TARGET_AARCH64) +#if !defined(ZEND_WIN32) && !defined(IR_TARGET_AARCH64) if (zend_jit_vm_kind == ZEND_VM_KIND_HYBRID) { zend_jit_set_sp_adj_vm(); // set zend_jit_hybrid_vm_sp_adj } @@ -5441,7 +5441,7 @@ static int zend_jit_add_arrays(zend_jit_ctx *jit, const zend_op *opline, uint32_ static int zend_jit_long_math_helper(zend_jit_ctx *jit, const zend_op *opline, uint8_t opcode, - uint8_t op1_type, + uint8_t op1_type, znode_op op1, zend_jit_addr op1_addr, uint32_t op1_info, @@ -7982,7 +7982,7 @@ static int zend_jit_type_check(zend_jit_ctx *jit, const zend_op *opline, uint32_ if (op1_info & (MAY_BE_ANY|MAY_BE_REF)) { mask = opline->extended_value; - if (!(op1_info & MAY_BE_GUARD) && !(op1_info & (MAY_BE_ANY - mask))) { + if (!(op1_info & MAY_BE_GUARD) && !(op1_info & (MAY_BE_ANY - mask))) { jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, opline); if (exit_addr) { if (smart_branch_opcode == ZEND_JMPNZ) { @@ -11840,7 +11840,7 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, if (opline->op2_type != IS_CONST) { ir_ref if_num, end1, ref2; - if_num = ir_IF( + if_num = ir_IF( ir_ULE( ir_LOAD_C(ir_ADD_OFFSET(key, offsetof(zend_string, val))), ir_CONST_CHAR('9'))); @@ -16030,7 +16030,7 @@ static void *zend_jit_finish(zend_jit_ctx *jit) // ir_mem_unprotect(entry, size); if (!(jit->ctx.flags & IR_FUNCTION) && zend_jit_vm_kind == ZEND_VM_KIND_HYBRID) { -#if !ZEND_WIN32 && !defined(IR_TARGET_AARCH64) +#if !defined(ZEND_WIN32) && !defined(IR_TARGET_AARCH64) sp_offset = zend_jit_hybrid_vm_sp_adj; #else sp_offset = sizeof(void*); diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index f688126cdf4f7..44d578d66be85 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -323,7 +323,7 @@ ZEND_INI_BEGIN() #ifndef ZEND_WIN32 STD_PHP_INI_ENTRY("opcache.preload_user" , "" , PHP_INI_SYSTEM, OnUpdateStringUnempty, accel_directives.preload_user, zend_accel_globals, accel_globals) #endif -#if ZEND_WIN32 +#ifdef ZEND_WIN32 STD_PHP_INI_ENTRY("opcache.cache_id" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.cache_id, zend_accel_globals, accel_globals) #endif #ifdef HAVE_JIT @@ -838,7 +838,7 @@ ZEND_FUNCTION(opcache_get_configuration) #ifndef ZEND_WIN32 add_assoc_string(&directives, "opcache.preload_user", STRING_NOT_NULL(ZCG(accel_directives).preload_user)); #endif -#if ZEND_WIN32 +#ifdef ZEND_WIN32 add_assoc_string(&directives, "opcache.cache_id", STRING_NOT_NULL(ZCG(accel_directives).cache_id)); #endif #ifdef HAVE_JIT diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index 31fae17267159..de6473a09bb57 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -44,7 +44,7 @@ #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif diff --git a/ext/random/csprng.c b/ext/random/csprng.c index fca8a50539cf4..aa186135aa02f 100644 --- a/ext/random/csprng.c +++ b/ext/random/csprng.c @@ -31,7 +31,7 @@ #include "php_random.h" #include "php_random_csprng.h" -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include #endif @@ -45,7 +45,7 @@ # include #endif -#if HAVE_SYS_PARAM_H +#ifdef HAVE_SYS_PARAM_H # include # if (__FreeBSD__ && __FreeBSD_version > 1200000) || (__DragonFly__ && __DragonFly_version >= 500700) || \ defined(__sun) || (defined(__NetBSD__) && __NetBSD_Version__ >= 1000000000) || defined(__midipix__) diff --git a/ext/random/random.c b/ext/random/random.c index 7af7603238706..b0dcd81e4de9f 100644 --- a/ext/random/random.c +++ b/ext/random/random.c @@ -34,7 +34,7 @@ #include "php_random_csprng.h" #include "ext/standard/sha1.h" -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include #endif @@ -46,7 +46,7 @@ # include #endif -#if HAVE_SYS_PARAM_H +#ifdef HAVE_SYS_PARAM_H # include #endif diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h index d7a79714a2c91..057ef18fd01d2 100644 --- a/ext/sockets/php_sockets.h +++ b/ext/sockets/php_sockets.h @@ -20,7 +20,7 @@ #ifndef PHP_SOCKETS_H #define PHP_SOCKETS_H -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/ext/standard/file.c b/ext/standard/file.c index 651c13a4f8df6..1d28e5ddf7ba9 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -45,7 +45,7 @@ # include "win32/fnmatch.h" # include "win32/ioutil.h" #else -# if HAVE_SYS_PARAM_H +# ifdef HAVE_SYS_PARAM_H # include # endif # if HAVE_SYS_SELECT_H @@ -54,7 +54,7 @@ # include # include # include -# if HAVE_ARPA_INET_H +# ifdef HAVE_ARPA_INET_H # include # endif #endif diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index c4165836ecbeb..ad0016cad5534 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1697,7 +1697,7 @@ PHP_FUNCTION(stream_isatty) #ifdef PHP_WIN32 /* Check if the Windows standard handle is redirected to file */ RETVAL_BOOL(php_win32_console_fileno_is_console(fileno)); -#elif HAVE_UNISTD_H +#elif defined(HAVE_UNISTD_H) /* Check if the file descriptor identifier is a terminal */ RETVAL_BOOL(isatty(fileno)); #else diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index d7644dcd06cd3..5ea432d6cefa4 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -40,12 +40,12 @@ #include "php_network.h" #include "zend_smart_str.h" -#if HAVE_PWD_H +#ifdef HAVE_PWD_H #include #endif #include -#if HAVE_SYS_SOCKET_H +#ifdef HAVE_SYS_SOCKET_H #include #endif @@ -54,7 +54,7 @@ #else #include #include -#if HAVE_ARPA_INET_H +#ifdef HAVE_ARPA_INET_H #include #endif #endif @@ -368,7 +368,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle) memset(file_handle, 0, sizeof(zend_file_handle)); path_info = SG(request_info).request_uri; -#if HAVE_PWD_H +#ifdef HAVE_PWD_H if (PG(user_dir) && *PG(user_dir) && path_info && '/' == path_info[0] && '~' == path_info[1]) { char *s = strchr(path_info + 2, '/'); diff --git a/main/main.c b/main/main.c index 330f87505bf8f..a3acaf94b7f8f 100644 --- a/main/main.c +++ b/main/main.c @@ -30,10 +30,10 @@ #include "win32/winutil.h" #include #endif -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif diff --git a/main/network.c b/main/network.c index 0bb7af359c28c..b015b59c86e21 100644 --- a/main/network.c +++ b/main/network.c @@ -33,7 +33,7 @@ #endif #include -#if HAVE_SYS_SOCKET_H +#ifdef HAVE_SYS_SOCKET_H #include #endif @@ -44,7 +44,7 @@ #ifdef HAVE_SYS_SELECT_H #include #endif -#if HAVE_POLL_H +#ifdef HAVE_POLL_H #include #elif HAVE_SYS_POLL_H #include @@ -54,7 +54,7 @@ #ifndef PHP_WIN32 #include #include -#if HAVE_ARPA_INET_H +#ifdef HAVE_ARPA_INET_H #include #endif #endif @@ -774,7 +774,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short struct sockaddr **sal, **psal, *sa; struct timeval working_timeout; socklen_t socklen; -#if HAVE_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY struct timeval limit_time, time_now; #endif @@ -787,7 +787,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short if (timeout) { memcpy(&working_timeout, timeout, sizeof(working_timeout)); -#if HAVE_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY gettimeofday(&limit_time, NULL); limit_time.tv_sec += working_timeout.tv_sec; limit_time.tv_usec += working_timeout.tv_usec; @@ -906,7 +906,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short } /* adjust timeout for next attempt */ -#if HAVE_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY if (timeout) { gettimeofday(&time_now, NULL); diff --git a/main/php.h b/main/php.h index b10ded010d129..c8a29d6c3955f 100644 --- a/main/php.h +++ b/main/php.h @@ -122,11 +122,11 @@ typedef int pid_t; #include #endif -#if HAVE_ALLOCA_H +#ifdef HAVE_ALLOCA_H #include #endif -#if HAVE_BUILD_DEFS_H +#ifdef HAVE_BUILD_DEFS_H #include #endif @@ -209,7 +209,7 @@ typedef unsigned int socklen_t; #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif @@ -220,7 +220,7 @@ typedef unsigned int socklen_t; #include "zend_stack.h" #include -#if HAVE_PWD_H +#ifdef HAVE_PWD_H # ifdef PHP_WIN32 #include "win32/param.h" # else diff --git a/main/php_ini.c b/main/php_ini.c index f795f1e09ce00..2fc4cca26553f 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -30,7 +30,7 @@ #include "win32/winutil.h" #endif -#if HAVE_SCANDIR && HAVE_ALPHASORT && HAVE_DIRENT_H +#if defined(HAVE_SCANDIR) && defined(HAVE_ALPHASORT) && defined(HAVE_DIRENT_H) #include #endif diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index dcea78358486d..07aaaaa3d9a2e 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -31,7 +31,7 @@ #include #include #include -#if HAVE_ARPA_INET_H +#ifdef HAVE_ARPA_INET_H #include #endif #endif diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index 5d36af946afc3..96675af6daea1 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -19,7 +19,7 @@ #include #endif -#if HAVE_SYS_SOCKET_H +#ifdef HAVE_SYS_SOCKET_H # include #endif diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 83a1b9fed49d5..fb2addb9e6de2 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -23,10 +23,10 @@ #include "ext/standard/php_filestat.h" #include #include -#if HAVE_SYS_WAIT_H +#ifdef HAVE_SYS_WAIT_H #include #endif -#if HAVE_SYS_FILE_H +#ifdef HAVE_SYS_FILE_H #include #endif #ifdef HAVE_SYS_MMAN_H diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index b6f28cc3dc26b..6a2f00a37f6dc 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -36,11 +36,11 @@ # include #endif -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H # include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include #endif @@ -48,11 +48,11 @@ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_WAIT_H +#ifdef HAVE_SYS_WAIT_H # include #endif @@ -1737,7 +1737,7 @@ int main(int argc, char *argv[]) int warmup_repeats = 0; int repeats = 1; int benchmark = 0; -#if HAVE_GETTIMEOFDAY +#ifdef HAVE_GETTIMEOFDAY struct timeval start, end; #else time_t start, end; diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 683a01b091a13..9250a3fa21dab 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -39,10 +39,10 @@ #include #include #endif -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 36bfb26eb0f92..f27c5440d6c8d 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -36,17 +36,17 @@ #include #endif -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include #include -#if HAVE_DLFCN_H +#ifdef HAVE_DLFCN_H #include #endif @@ -222,7 +222,7 @@ static const php_cli_server_http_response_status_code_pair template_map[] = { static int php_cli_server_log_level = 3; -#if HAVE_UNISTD_H || defined(PHP_WIN32) +#if defined(HAVE_UNISTD_H) || defined(PHP_WIN32) static int php_cli_output_is_tty = OUTPUT_NOT_CHECKED; #endif @@ -1164,7 +1164,7 @@ static bool php_cli_server_content_sender_pull(php_cli_server_content_sender *se return true; } /* }}} */ -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H static int php_cli_is_output_tty(void) /* {{{ */ { if (php_cli_output_is_tty == OUTPUT_NOT_CHECKED) { @@ -1199,7 +1199,7 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu } } -#if HAVE_UNISTD_H || defined(PHP_WIN32) +#if defined(HAVE_UNISTD_H) || defined(PHP_WIN32) if (CLI_SERVER_G(color) && php_cli_is_output_tty() == OUTPUT_IS_TTY) { if (effective_status >= 500) { /* server error: red */ diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 9c2f4e1344232..d3819c79175dd 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -30,17 +30,15 @@ #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include #include -#if HAVE_SYS_TYPES_H - +#ifdef HAVE_SYS_TYPES_H #include - #endif #include diff --git a/sapi/litespeed/lscriu.c b/sapi/litespeed/lscriu.c index 42b59ff56eba3..1eb468fdf28cc 100644 --- a/sapi/litespeed/lscriu.c +++ b/sapi/litespeed/lscriu.c @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif @@ -60,10 +60,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#if HAVE_SYS_TYPES_H - +#ifdef HAVE_SYS_TYPES_H #include - #endif #include diff --git a/win32/ioutil.h b/win32/ioutil.h index d92e3fb8f5123..f6105a87f2468 100644 --- a/win32/ioutil.h +++ b/win32/ioutil.h @@ -683,7 +683,7 @@ __forceinline static char *php_win32_ioutil_realpath(const char *path, char *res }/*}}}*/ #include -#if _WIN64 +#ifdef _WIN64 typedef unsigned __int64 php_win32_ioutil_dev_t; typedef unsigned __int64 php_win32_ioutil_ino_t; typedef __time64_t php_win32_ioutil_time_t;