From 0e016f2843be44f6c3bfc0e97fd2ac91bafc290f Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Tue, 12 May 2020 17:55:35 +0200 Subject: [PATCH] Fix [-Wundef] warning in BZip2 extension --- ext/bz2/bz2.c | 8 ++++---- ext/bz2/php_bz2.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index ee690dbda3..575c129422 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -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); diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h index bfa3ce690d..93514d7466 100644 --- a/ext/bz2/php_bz2.h +++ b/ext/bz2/php_bz2.h @@ -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 -- 2.40.0