summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-05-12 17:59:17 +0200
committerGeorge Peter Banyard <girgias@php.net>2020-05-16 15:31:20 +0200
commit68164f40ce1909208cfa47fe9c2134718bd780a5 (patch)
tree727778d84caa74cb05ffcd029fedee804d256797
parentc19887496e9a3d3516368aa3cd8219e48e4fdca4 (diff)
downloadphp-git-68164f40ce1909208cfa47fe9c2134718bd780a5.tar.gz
Fix [-Wundef] warning in MBString extension
-rw-r--r--ext/mbstring/mb_gpc.c2
-rw-r--r--ext/mbstring/mb_gpc.h2
-rw-r--r--ext/mbstring/mbstring.c28
-rw-r--r--ext/mbstring/mbstring.h6
-rw-r--r--ext/mbstring/mbstring.stub.php2
-rw-r--r--ext/mbstring/mbstring_arginfo.h96
-rw-r--r--ext/mbstring/php_mbregex.c4
-rw-r--r--ext/mbstring/php_mbregex.h2
-rw-r--r--ext/mbstring/php_unicode.c2
-rw-r--r--ext/mbstring/php_unicode.h2
10 files changed, 73 insertions, 73 deletions
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index 01f3d8ce8b..5af2d8a486 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -41,7 +41,7 @@
#include "mb_gpc.h"
/* }}} */
-#if HAVE_MBSTRING
+#ifdef HAVE_MBSTRING
ZEND_EXTERN_MODULE_GLOBALS(mbstring)
diff --git a/ext/mbstring/mb_gpc.h b/ext/mbstring/mb_gpc.h
index 07c5d1137f..fb4f927820 100644
--- a/ext/mbstring/mb_gpc.h
+++ b/ext/mbstring/mb_gpc.h
@@ -23,7 +23,7 @@
#include "php.h"
/* }}} */
-#if HAVE_MBSTRING
+#ifdef HAVE_MBSTRING
/* {{{ typedefs */
typedef struct _php_mb_encoding_handler_info_t {
const char *separator;
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index a70e16071b..779ba3417e 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -53,12 +53,12 @@
#include "mb_gpc.h"
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
# include "php_mbregex.h"
# include "php_onig_compat.h"
# include <oniguruma.h>
# undef UChar
-#if ONIGURUMA_VERSION_INT < 60800
+# if !defined(ONIGURUMA_VERSION_INT) || ONIGURUMA_VERSION_INT < 60800
typedef void OnigMatchParam;
#define onig_new_match_param() (NULL)
#define onig_initialize_match_param(x) (void)(x)
@@ -69,7 +69,7 @@ typedef void OnigMatchParam;
onig_search(reg, str, end, start, range, region, option)
#define onig_match_with_param(re, str, end, at, region, option, mp) \
onig_match(re, str, end, at, region, option)
-#endif
+# endif
#else
# include "ext/pcre/php_pcre.h"
#endif
@@ -78,7 +78,7 @@ onig_match(re, str, end, at, region, option)
#include "mbstring_arginfo.h"
/* }}} */
-#if HAVE_MBSTRING
+#ifdef HAVE_MBSTRING
/* {{{ prototypes */
ZEND_DECLARE_MODULE_GLOBALS(mbstring)
@@ -554,7 +554,7 @@ static void *_php_mb_compile_regex(const char *pattern);
static int _php_mb_match_regex(void *opaque, const char *str, size_t str_len);
static void _php_mb_free_regex(void *opaque);
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
/* {{{ _php_mb_compile_regex */
static void *_php_mb_compile_regex(const char *pattern)
{
@@ -906,7 +906,7 @@ static int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, siz
}
MBSTRG(internal_encoding) = encoding;
MBSTRG(current_internal_encoding) = encoding;
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
{
const char *enc_name = new_value;
if (FAILURE == php_mb_regex_set_default_mbctype(enc_name)) {
@@ -1054,7 +1054,7 @@ PHP_INI_BEGIN()
PHP_INI_ALL,
OnUpdateBool,
strict_detection, zend_mbstring_globals, mbstring_globals)
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
STD_PHP_INI_ENTRY("mbstring.regex_stack_limit", "100000",PHP_INI_ALL, OnUpdateLong, regex_stack_limit, zend_mbstring_globals, mbstring_globals)
STD_PHP_INI_ENTRY("mbstring.regex_retry_limit", "1000000",PHP_INI_ALL, OnUpdateLong, regex_retry_limit, zend_mbstring_globals, mbstring_globals)
#endif
@@ -1113,7 +1113,7 @@ ZEND_TSRMLS_CACHE_UPDATE();
mbstring_globals->strict_detection = 0;
mbstring_globals->outconv = NULL;
mbstring_globals->http_output_conv_mimetypes = NULL;
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
mbstring_globals->mb_regex_globals = php_mb_regex_globals_alloc();
#endif
mbstring_globals->last_used_encoding_name = NULL;
@@ -1136,7 +1136,7 @@ static PHP_GSHUTDOWN_FUNCTION(mbstring)
if (mbstring_globals->http_output_conv_mimetypes) {
_php_mb_free_regex(mbstring_globals->http_output_conv_mimetypes);
}
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
php_mb_regex_globals_free(mbstring_globals->mb_regex_globals);
#endif
}
@@ -1174,7 +1174,7 @@ ZEND_TSRMLS_CACHE_UPDATE();
REGISTER_LONG_CONSTANT("MB_CASE_TITLE_SIMPLE", PHP_UNICODE_CASE_TITLE_SIMPLE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MB_CASE_FOLD_SIMPLE", PHP_UNICODE_CASE_FOLD_SIMPLE, CONST_CS | CONST_PERSISTENT);
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_MINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
@@ -1201,7 +1201,7 @@ PHP_MSHUTDOWN_FUNCTION(mbstring)
zend_multibyte_restore_functions();
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_MSHUTDOWN(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
@@ -1223,7 +1223,7 @@ PHP_RINIT_FUNCTION(mbstring)
php_mb_populate_current_detect_order_list();
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_RINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
zend_multibyte_set_internal_encoding((const zend_encoding *)MBSTRG(internal_encoding));
@@ -1262,7 +1262,7 @@ PHP_RSHUTDOWN_FUNCTION(mbstring)
MBSTRG(http_output_set) = 0;
MBSTRG(http_input_set) = 0;
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_RSHUTDOWN(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
@@ -1288,7 +1288,7 @@ PHP_MINFO_FUNCTION(mbstring)
php_info_print_table_header(1, "mbstring extension makes use of \"streamable kanji code filter and converter\", which is distributed under the GNU Lesser General Public License version 2.1.");
php_info_print_table_end();
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_MINFO(mb_regex)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
#endif
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 14003c5d9a..380e0b4568 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -45,7 +45,7 @@
#endif
-#if HAVE_MBSTRING
+#ifdef HAVE_MBSTRING
#include "libmbfl/mbfl/mbfilter.h"
#include "SAPI.h"
@@ -108,7 +108,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mbstring)
size_t illegalchars;
mbfl_buffer_converter *outconv;
void *http_output_conv_mimetypes;
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
struct _zend_mb_regex_globals *mb_regex_globals;
zend_long regex_stack_limit;
#endif
@@ -118,7 +118,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mbstring)
zend_bool internal_encoding_set;
zend_bool http_output_set;
zend_bool http_input_set;
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
zend_long regex_retry_limit;
#endif
ZEND_END_MODULE_GLOBALS(mbstring)
diff --git a/ext/mbstring/mbstring.stub.php b/ext/mbstring/mbstring.stub.php
index 3a1fc929ac..789423dbc8 100644
--- a/ext/mbstring/mbstring.stub.php
+++ b/ext/mbstring/mbstring.stub.php
@@ -88,7 +88,7 @@ function mb_ord(string $str, string $encoding = UNKNOWN): int|false {}
function mb_chr(int $cp, string $encoding = UNKNOWN): string|false {}
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
function mb_regex_encoding(string $encoding = UNKNOWN): string|bool {}
function mb_ereg(string $pattern, string $string, &$registers = UNKNOWN): int|false {}
diff --git a/ext/mbstring/mbstring_arginfo.h b/ext/mbstring/mbstring_arginfo.h
index 57559f8ccd..47f0f2db44 100644
--- a/ext/mbstring/mbstring_arginfo.h
+++ b/ext/mbstring/mbstring_arginfo.h
@@ -205,13 +205,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_chr, 0, 1, MAY_BE_STRING|MAY_
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_END_ARG_INFO()
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_regex_encoding, 0, 0, MAY_BE_STRING|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
@@ -219,11 +219,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg, 0, 2, MAY_BE_LONG|MAY_B
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
#define arginfo_mb_eregi arginfo_mb_ereg
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace, 0, 3, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, replacement, IS_STRING, 0)
@@ -232,11 +232,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace, 0, 3, MAY_BE_ST
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
#define arginfo_mb_eregi_replace arginfo_mb_ereg_replace
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace_callback, 0, 3, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
@@ -245,7 +245,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace_callback, 0, 3,
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_split, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
@@ -253,7 +253,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_split, 0, 2, MAY_BE_ARRAY|MAY
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_match, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
@@ -261,22 +261,22 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_match, 0, 2, _IS_BOOL, 0
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_search, 0, 0, MAY_BE_ARRAY|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
#define arginfo_mb_ereg_search_pos arginfo_mb_ereg_search
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
#define arginfo_mb_ereg_search_regs arginfo_mb_ereg_search
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_init, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
@@ -284,23 +284,23 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_init, 0, 1, _IS_B
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_search_getregs, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_getpos, 0, 0, IS_LONG, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_setpos, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_regex_set_options, 0, 0, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, options, IS_STRING, 0)
ZEND_END_ARG_INFO()
@@ -350,52 +350,52 @@ ZEND_FUNCTION(mb_check_encoding);
ZEND_FUNCTION(mb_scrub);
ZEND_FUNCTION(mb_ord);
ZEND_FUNCTION(mb_chr);
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_regex_encoding);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_eregi);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_replace);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_eregi_replace);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_replace_callback);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_split);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_match);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_pos);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_regs);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_init);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_getregs);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_getpos);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_setpos);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_regex_set_options);
#endif
@@ -444,52 +444,52 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(mb_scrub, arginfo_mb_scrub)
ZEND_FE(mb_ord, arginfo_mb_ord)
ZEND_FE(mb_chr, arginfo_mb_chr)
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_regex_encoding, arginfo_mb_regex_encoding)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg, arginfo_mb_ereg)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_eregi, arginfo_mb_eregi)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_replace, arginfo_mb_ereg_replace)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_eregi_replace, arginfo_mb_eregi_replace)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_replace_callback, arginfo_mb_ereg_replace_callback)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_split, arginfo_mb_split)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_match, arginfo_mb_ereg_match)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search, arginfo_mb_ereg_search)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_pos, arginfo_mb_ereg_search_pos)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_regs, arginfo_mb_ereg_search_regs)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_init, arginfo_mb_ereg_search_init)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_getregs, arginfo_mb_ereg_search_getregs)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_getpos, arginfo_mb_ereg_search_getpos)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_setpos, arginfo_mb_ereg_search_setpos)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_regex_set_options, arginfo_mb_regex_set_options)
#endif
ZEND_FE_END
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 43855545d7..bc36596988 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -21,7 +21,7 @@
#include "php.h"
#include "php_ini.h"
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
#include "zend_smart_str.h"
#include "ext/standard/info.h"
@@ -33,7 +33,7 @@
#include <oniguruma.h>
#undef UChar
-#if ONIGURUMA_VERSION_INT < 60800
+#if !defined(ONIGURUMA_VERSION_INT) || ONIGURUMA_VERSION_INT < 60800
typedef void OnigMatchParam;
#define onig_new_match_param() (NULL)
#define onig_initialize_match_param(x) (void)(x)
diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h
index 64463da01c..78b9142542 100644
--- a/ext/mbstring/php_mbregex.h
+++ b/ext/mbstring/php_mbregex.h
@@ -17,7 +17,7 @@
#ifndef _PHP_MBREGEX_H
#define _PHP_MBREGEX_H
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
#include "php.h"
#include "zend.h"
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index ba84dc55c7..dc0c3f0831 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -35,7 +35,7 @@
#include "php.h"
#include "php_ini.h"
-#if HAVE_MBSTRING
+#ifdef HAVE_MBSTRING
/* include case folding data generated from the official UnicodeData.txt file */
#include "mbstring.h"
diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h
index 2cd6dd9539..26d0979ca4 100644
--- a/ext/mbstring/php_unicode.h
+++ b/ext/mbstring/php_unicode.h
@@ -31,7 +31,7 @@
#ifndef PHP_UNICODE_H
#define PHP_UNICODE_H
-#if HAVE_MBSTRING
+#ifdef HAVE_MBSTRING
#define UC_MN 0 /* Mark, Non-Spacing */
#define UC_MC 1 /* Mark, Spacing Combining */