]> granicus.if.org Git - php/commitdiff
Fix [-Wundef] warning in BZip2 extension
authorGeorge Peter Banyard <girgias@php.net>
Tue, 12 May 2020 15:55:35 +0000 (17:55 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Sat, 16 May 2020 13:31:12 +0000 (15:31 +0200)
ext/bz2/bz2.c
ext/bz2/php_bz2.h

index ee690dbda3c0c0893290b48239dbd497741b619e..575c1294221fe28e95bb5da0b7e972eaf740c211 100644 (file)
@@ -22,7 +22,7 @@
 #include "php_bz2.h"
 #include "bz2_arginfo.h"
 
-#if HAVE_BZ2
+#ifdef HAVE_BZ2
 
 /* PHP Includes */
 #include "ext/standard/info.h"
@@ -504,7 +504,7 @@ PHP_FUNCTION(bzdecompress)
        size_t source_len;
        int error;
        zend_long small = 0;
-#if defined(PHP_WIN32)
+#ifdef PHP_WIN32
        unsigned __int64 size = 0;
 #else
        unsigned long long size = 0;
@@ -534,7 +534,7 @@ PHP_FUNCTION(bzdecompress)
                /* compression is better then 2:1, need to allocate more memory */
                bzs.avail_out = source_len;
                size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
-#if !ZEND_ENABLE_ZVAL_LONG64
+#ifndef ZEND_ENABLE_ZVAL_LONG64
                if (size > SIZE_MAX) {
                        /* no reason to continue if we're going to drop it anyway */
                        break;
@@ -546,7 +546,7 @@ PHP_FUNCTION(bzdecompress)
 
        if (error == BZ_STREAM_END || error == BZ_OK) {
                size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
-#if !ZEND_ENABLE_ZVAL_LONG64
+#ifndef ZEND_ENABLE_ZVAL_LONG64
                if (UNEXPECTED(size > SIZE_MAX)) {
                        php_error_docref(NULL, E_WARNING, "Decompressed size too big, max is %zd", SIZE_MAX);
                        zend_string_efree(dest);
index bfa3ce690dd2b0b24511a94b981883aecec81d0d..93514d74660bb417ad1cdf7b9c1f00b58b5cfabb 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef PHP_BZ2_H
 #define PHP_BZ2_H
 
-#if HAVE_BZ2
+#ifdef HAVE_BZ2
 
 extern zend_module_entry bz2_module_entry;
 #define phpext_bz2_ptr &bz2_module_entry