]> granicus.if.org Git - php/commitdiff
Fix [-Wundef] warning in SPL extension
authorGeorge Peter Banyard <girgias@php.net>
Wed, 20 May 2020 15:36:27 +0000 (17:36 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Wed, 20 May 2020 16:22:10 +0000 (18:22 +0200)
ext/spl/spl_directory.c

index 8ede8a31296e82c72d10455072b31d10c5752e4d..0ab47396a05681d53d7cfb7be03b303b9817278a 100644 (file)
@@ -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;