summaryrefslogtreecommitdiff
path: root/ext/nkf/nkf-utf8/nkf.h
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-07 02:59:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-07 02:59:38 +0000
commit10ddffb278e4a27dc6d7a4e6ecee342fe2b56741 (patch)
treeff72e7a75398b095b24e10bf6b26287886f69c70 /ext/nkf/nkf-utf8/nkf.h
parent2657faae0193748c041d8311590dd5f03dd2ce0b (diff)
* nkf.c: update to r1.188. fixes for 16bit environment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/nkf-utf8/nkf.h')
-rw-r--r--ext/nkf/nkf-utf8/nkf.h36
1 files changed, 27 insertions, 9 deletions
diff --git a/ext/nkf/nkf-utf8/nkf.h b/ext/nkf/nkf-utf8/nkf.h
index 1dbae54f20..49f3b7ff34 100644
--- a/ext/nkf/nkf-utf8/nkf.h
+++ b/ext/nkf/nkf-utf8/nkf.h
@@ -51,7 +51,7 @@ typedef int nkf_char;
#define NKF_INT32_C(n) (n)
#endif
-#if (defined(__TURBOC__) || defined(_MSC_VER) || defined(LSI_C) || defined(__MINGW32__) || defined(__EMX__) || defined(__MSDOS__) || defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__)) && !defined(MSDOS)
+#if (defined(__TURBOC__) || defined(_MSC_VER) || defined(LSI_C) || (defined(__WATCOMC__) && defined(__386__) && !defined(__LINUX__)) || defined(__MINGW32__) || defined(__EMX__) || defined(__MSDOS__) || defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__)) && !defined(MSDOS)
#define MSDOS
#if (defined(__Win32__) || defined(_WIN32)) && !defined(__WIN32__)
#define __WIN32__
@@ -143,15 +143,34 @@ void setbinmode(FILE *fp)
#endif
#endif
+#if !defined(DEFAULT_CODE_JIS) && !defined(DEFAULT_CODE_SJIS) && \
+ !defined(DEFAULT_CODE_WINDOWS_31J) && !defined(DEFAULT_CODE_EUC) && \
+ !defined(DEFAULT_CODE_UTF8) && !defined(DEFAULT_CODE_LOCALE)
+#define DEFAULT_CODE_LOCALE
+#endif
+
#ifdef DEFAULT_CODE_LOCALE
-#ifndef __WIN32__ /* not win32 is posix */
-#ifndef HAVE_LANGINFO_H
-#define HAVE_LANGINFO_H
-#endif
-#ifndef HAVE_LOCALE_H
-#define HAVE_LOCALE_H
-#endif
+#if defined(__WIN32__) /* not win32 should be posix */
+# ifndef HAVE_LOCALE_H
+# define HAVE_LOCALE_H
+# endif
+#elif defined(__OS2__)
+# undef HAVE_LANGINFO_H /* We do not use kLIBC's langinfo. */
+# ifndef HAVE_LOCALE_H
+# define HAVE_LOCALE_H
+# endif
+#elif defined(MSDOS)
+# ifndef HAVE_LOCALE_H
+# define HAVE_LOCALE_H
+# endif
+#else
+# ifndef HAVE_LANGINFO_H
+# define HAVE_LANGINFO_H
+# endif
+# ifndef HAVE_LOCALE_H
+# define HAVE_LOCALE_H
+# endif
#endif
#ifdef HAVE_LANGINFO_H
@@ -171,4 +190,3 @@ void setbinmode(FILE *fp)
#endif
#endif /* NKF_H */
-