Skip to content

Commit 17ca010

Browse files
committed
Fix [-Wundef] warning in BZip2 extension
1 parent 8fe3547 commit 17ca010

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ext/bz2/bz2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "php_bz2.h"
2323
#include "bz2_arginfo.h"
2424

25-
#if HAVE_BZ2
25+
#ifdef HAVE_BZ2
2626

2727
/* PHP Includes */
2828
#include "ext/standard/info.h"
@@ -504,7 +504,7 @@ PHP_FUNCTION(bzdecompress)
504504
size_t source_len;
505505
int error;
506506
zend_long small = 0;
507-
#if defined(PHP_WIN32)
507+
#ifdef PHP_WIN32
508508
unsigned __int64 size = 0;
509509
#else
510510
unsigned long long size = 0;
@@ -534,7 +534,7 @@ PHP_FUNCTION(bzdecompress)
534534
/* compression is better then 2:1, need to allocate more memory */
535535
bzs.avail_out = source_len;
536536
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
537-
#if !ZEND_ENABLE_ZVAL_LONG64
537+
#ifndef ZEND_ENABLE_ZVAL_LONG64
538538
if (size > SIZE_MAX) {
539539
/* no reason to continue if we're going to drop it anyway */
540540
break;
@@ -546,7 +546,7 @@ PHP_FUNCTION(bzdecompress)
546546

547547
if (error == BZ_STREAM_END || error == BZ_OK) {
548548
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
549-
#if !ZEND_ENABLE_ZVAL_LONG64
549+
#ifndef ZEND_ENABLE_ZVAL_LONG64
550550
if (UNEXPECTED(size > SIZE_MAX)) {
551551
php_error_docref(NULL, E_WARNING, "Decompressed size too big, max is %zd", SIZE_MAX);
552552
zend_string_efree(dest);

ext/bz2/php_bz2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef PHP_BZ2_H
1818
#define PHP_BZ2_H
1919

20-
#if HAVE_BZ2
20+
#ifdef HAVE_BZ2
2121

2222
extern zend_module_entry bz2_module_entry;
2323
#define phpext_bz2_ptr &bz2_module_entry

0 commit comments

Comments
 (0)