summaryrefslogtreecommitdiff
path: root/missing/langinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'missing/langinfo.c')
-rw-r--r--missing/langinfo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/missing/langinfo.c b/missing/langinfo.c
index 6373afd0f5..0274a378f5 100644
--- a/missing/langinfo.c
+++ b/missing/langinfo.c
@@ -32,11 +32,12 @@
* http://www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c
*/
+#include "ruby/missing.h"
#include <stdlib.h>
#include <string.h>
#if defined _WIN32 || defined __CYGWIN__
#include <windows.h>
-#if defined _WIN32
+#if defined _WIN32 && !defined strncasecmp
#define strncasecmp strnicmp
#endif
#endif
@@ -55,7 +56,7 @@
#endif
#define digit(x) ((x) >= '0' && (x) <= '9')
-#define strstart(s, n) (strncasecmp(s, n, strlen(n)) == 0)
+#define strstart(s, n) (strncasecmp((s), (n), strlen(n)) == 0)
static char buf[16];
@@ -64,7 +65,7 @@ nl_langinfo_codeset(void)
{
const char *l, *p;
int n;
-
+
if (((l = getenv("LC_ALL")) && *l) ||
((l = getenv("LC_CTYPE")) && *l) ||
((l = getenv("LANG")) && *l)) {
@@ -139,7 +140,7 @@ char *nl_langinfo(nl_item item)
#ifdef TEST
#include <stdio.h>
-int main()
+int main(void)
{
printf("%s\n", nl_langinfo(CODESET));
return 0;