Skip to content

Commit 8c3574b

Browse files
committed
Remove php_my_setlocale workaround
This works around a macro-expansion issue that is no longer relevant in PHP 8.
1 parent 7a6ae9b commit 8c3574b

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

ext/standard/string.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,8 @@
2626
# include <langinfo.h>
2727
#endif
2828

29-
/*
30-
* This define is here because some versions of libintl redefine setlocale
31-
* to point to libintl_setlocale. That's a ridiculous thing to do as far
32-
* as I am concerned, but with this define and the subsequent undef we
33-
* limit the damage to just the actual setlocale() call in this file
34-
* without turning zif_setlocale into zif_libintl_setlocale. -Rasmus
35-
*/
36-
#define php_my_setlocale setlocale
3729
#ifdef HAVE_LIBINTL
3830
# include <libintl.h> /* For LC_MESSAGES */
39-
#ifdef setlocale
40-
# undef setlocale
41-
#endif
4231
#endif
4332

4433
#include "scanf.h"
@@ -4661,7 +4650,7 @@ PHP_FUNCTION(setlocale)
46614650
}
46624651

46634652
# ifndef PHP_WIN32
4664-
retval = php_my_setlocale(cat, loc ? ZSTR_VAL(loc) : NULL);
4653+
retval = setlocale(cat, loc ? ZSTR_VAL(loc) : NULL);
46654654
# else
46664655
if (loc) {
46674656
/* BC: don't try /^[a-z]{2}_[A-Z]{2}($|\..*)/ except for /^u[ks]_U[KS]$/ */
@@ -4676,10 +4665,10 @@ PHP_FUNCTION(setlocale)
46764665
) {
46774666
retval = NULL;
46784667
} else {
4679-
retval = php_my_setlocale(cat, ZSTR_VAL(loc));
4668+
retval = setlocale(cat, ZSTR_VAL(loc));
46804669
}
46814670
} else {
4682-
retval = php_my_setlocale(cat, NULL);
4671+
retval = setlocale(cat, NULL);
46834672
}
46844673
# endif
46854674
zend_update_current_locale();

0 commit comments

Comments
 (0)