Skip to content

Commit 530d97b

Browse files
committed
Fix [-Wundef] warning in MBString extension
1 parent 3098150 commit 530d97b

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

ext/mbstring/mbstring.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353

5454
#include "mb_gpc.h"
5555

56-
#if HAVE_MBREGEX
56+
#ifdef HAVE_MBREGEX
5757
# include "php_mbregex.h"
5858
# include "php_onig_compat.h"
5959
# include <oniguruma.h>
6060
# undef UChar
61-
#if ONIGURUMA_VERSION_INT < 60800
61+
# if !defined(ONIGURUMA_VERSION_INT) || ONIGURUMA_VERSION_INT < 60800
6262
typedef void OnigMatchParam;
6363
#define onig_new_match_param() (NULL)
6464
#define onig_initialize_match_param(x) (void)(x)
@@ -69,7 +69,7 @@ typedef void OnigMatchParam;
6969
onig_search(reg, str, end, start, range, region, option)
7070
#define onig_match_with_param(re, str, end, at, region, option, mp) \
7171
onig_match(re, str, end, at, region, option)
72-
#endif
72+
# endif
7373
#else
7474
# include "ext/pcre/php_pcre.h"
7575
#endif

ext/mbstring/mbstring.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#endif
4646

4747

48-
#if HAVE_MBSTRING
48+
#ifdef HAVE_MBSTRING
4949

5050
#include "libmbfl/mbfl/mbfilter.h"
5151
#include "SAPI.h"
@@ -108,7 +108,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mbstring)
108108
size_t illegalchars;
109109
mbfl_buffer_converter *outconv;
110110
void *http_output_conv_mimetypes;
111-
#if HAVE_MBREGEX
111+
#ifdef HAVE_MBREGEX
112112
struct _zend_mb_regex_globals *mb_regex_globals;
113113
zend_long regex_stack_limit;
114114
#endif
@@ -118,7 +118,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mbstring)
118118
zend_bool internal_encoding_set;
119119
zend_bool http_output_set;
120120
zend_bool http_input_set;
121-
#if HAVE_MBREGEX
121+
#ifdef HAVE_MBREGEX
122122
zend_long regex_retry_limit;
123123
#endif
124124
ZEND_END_MODULE_GLOBALS(mbstring)

ext/mbstring/php_mbregex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "php.h"
2222
#include "php_ini.h"
2323

24-
#if HAVE_MBREGEX
24+
#ifdef HAVE_MBREGEX
2525

2626
#include "zend_smart_str.h"
2727
#include "ext/standard/info.h"
@@ -33,7 +33,7 @@
3333
#include <oniguruma.h>
3434
#undef UChar
3535

36-
#if ONIGURUMA_VERSION_INT < 60800
36+
#if !defined(ONIGURUMA_VERSION_INT) || ONIGURUMA_VERSION_INT < 60800
3737
typedef void OnigMatchParam;
3838
#define onig_new_match_param() (NULL)
3939
#define onig_initialize_match_param(x) (void)(x)

ext/mbstring/php_mbregex.h

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

20-
#if HAVE_MBREGEX
20+
#ifdef HAVE_MBREGEX
2121

2222
#include "php.h"
2323
#include "zend.h"

0 commit comments

Comments
 (0)