]> granicus.if.org Git - php/commitdiff
Tweak the fix for bug #51847 to still call libintl_setlocale
authorRasmus Lerdorf <rasmus@php.net>
Wed, 2 Jun 2010 19:24:36 +0000 (19:24 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 2 Jun 2010 19:24:36 +0000 (19:24 +0000)
when libintl has done that redefine.

ext/standard/string.c

index dd8936d31fdf59db60f4fe3745f754e1947eb4de..312649b9a5013b71394ddfe79c2fd68d1fddfc63 100644 (file)
 #ifdef HAVE_MONETARY_H
 # include <monetary.h>
 #endif
+/* 
+ * This define is here because some versions of libintl redefine setlocale
+ * to point to libintl_setlocale.  That's a ridiculous thing to do as far
+ * as * I am concerned, but with this define and the subsequent undef we
+ * limit * the damage to just the actual setlocale() call in this file
+ * without * turning zif_setlocale into zif_libintl_setlocale.  -Rasmus
+ */
+#define php_my_setlocale setlocale
 #ifdef HAVE_LIBINTL
 # include <libintl.h> /* For LC_MESSAGES */
  #ifdef setlocale
- # undef setlocale /* Uh, libintl, don't F* our symbols please */
+ # undef setlocale
  #endif
 #endif
 
@@ -4176,7 +4184,7 @@ PHP_FUNCTION(setlocale)
                        }
                }
 
-               retval = setlocale (cat, loc);
+               retval = php_my_setlocale (cat, loc);
                zend_update_current_locale();
                if (retval) {
                        /* Remember if locale was changed */