From: George Peter Banyard Date: Wed, 20 May 2020 15:36:27 +0000 (+0200) Subject: Fix [-Wundef] warning in SPL extension X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a151225dc90ed43bc98381ce2375325d66dc471;p=php Fix [-Wundef] warning in SPL extension --- diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 8ede8a3129..0ab47396a0 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -411,7 +411,7 @@ void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, } p1 = strrchr(intern->file_name, '/'); -#if defined(PHP_WIN32) +#ifdef PHP_WIN32 p2 = strrchr(intern->file_name, '\\'); #else p2 = 0; @@ -435,7 +435,7 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o zend_error_handling error_handling; if (!file_path || !file_path_len) { -#if defined(PHP_WIN32) +#ifdef PHP_WIN32 zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot create SplFileInfo for empty path"); if (file_path && !use_copy) { efree(file_path); @@ -1252,7 +1252,7 @@ PHP_METHOD(SplFileInfo, getLinkTarget) if (intern->file_name == NULL) { spl_filesystem_object_get_file_name(intern); } -#if defined(PHP_WIN32) || HAVE_SYMLINK +#if defined(PHP_WIN32) || defined(HAVE_SYMLINK) if (intern->file_name == NULL) { php_error_docref(NULL, E_WARNING, "Empty filename"); RETURN_FALSE; @@ -2152,7 +2152,7 @@ PHP_METHOD(SplFileObject, __construct) tmp_path = estrndup(intern->u.file.stream->orig_path, tmp_path_len); p1 = strrchr(tmp_path, '/'); -#if defined(PHP_WIN32) +#ifdef PHP_WIN32 p2 = strrchr(tmp_path, '\\'); #else p2 = 0;