Upgrade to Win32-0.37
[p5sagit/p5-mst-13.2.git] / ext / I18N / Langinfo / Langinfo.xs
index 47223d7..c1da981 100644 (file)
@@ -3,47 +3,30 @@
 #include "XSUB.h"
 
 #ifdef I_LANGINFO
+#   define __USE_GNU 1 /* Enables YESSTR, otherwise only __YESSTR. */
 #   include <langinfo.h>
 #endif
 
-#include "constants.c"
+#include "const-c.inc"
 
 MODULE = I18N::Langinfo        PACKAGE = I18N::Langinfo
 
 PROTOTYPES: ENABLE
 
-INCLUDE: constants.xs
+INCLUDE: const-xs.inc
 
 SV*
 langinfo(code)
        int     code
   CODE:
 #ifdef HAS_NL_LANGINFO
-       char *s;
-       if (code > 0) { /* bold assumption: all valid langinfo codes > 0 */
-#ifdef _MAXSTRMSG
-           if (code >= _MAXSTRMSG
-               RETVAL = &PL_sv_undef;
-           else
-#else
-#   ifdef _NL_NUM_ITEMS
-           if (code >= _NL_NUM_ITEMS)
-               RETVAL = &PL_sv_undef;
-           else
-#   else
-#       ifdef _NL_NUM
-           if (code >= _NL_NUM)
-               RETVAL = &PL_sv_undef;
-           else
-#       endif
-#   endif
-#endif
-           {
-               s = nl_langinfo(code);
-               RETVAL = newSVpvn(s, strlen(s));
-           }
-       } else {
-           RETVAL = &PL_sv_undef;
+       {
+         char *s;
+
+         if ((s = nl_langinfo(code)))
+             RETVAL = newSVpvn(s, strlen(s));
+         else
+             RETVAL = &PL_sv_undef;
        }
 #else
        croak("nl_langinfo() not implemented on this architecture");