]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
OS/2 update from Andrew Zabolotny <zap@cobra.ru>.
authorBruno Haible <bruno@clisp.org>
Fri, 15 Mar 2002 18:32:24 +0000 (18:32 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:07:51 +0000 (12:07 +0200)
intl/ChangeLog
intl/os2compat.c
intl/os2compat.h

index d99a9cdbcff0095819083cf15fb671ce9e0f9286..119b3b47692c7e0af6c300ed9ebf4829e49dff66 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-15  Andrew Zabolotny  <zap@cobra.ru>
+
+       * os2compat.h: Use prefix _nlos2 instead of _os2, to avoid any
+       possible name clashes.
+       * os2compat.c: Likewise.
+
 2002-03-15  Bruno Haible  <bruno@clisp.org>
 
        * libgnuintl.h (LC_MESSAGES): Don't define on Solaris 2.5, to avoid
index 681e98aea7dda5831d4f94b3866eb1fc6f81f899..3ca826666af4a364cfbdd1fc8d1acb644838e5bc 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <sys/param.h>
 
 /* A version of getenv() that works from DLLs */
 extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue);
@@ -38,64 +39,60 @@ _nl_getenv (const char *name)
 }
 
 /* A fixed size buffer.  */
-#define LOCALEDIR_MAX 260
-char _nl_default_dirname__[LOCALEDIR_MAX+1];
+char _nl_default_dirname__[MAXPATHLEN+1];
 
-char *_os2_libdir = NULL;
-char *_os2_localealiaspath = NULL;
-char *_os2_localedir = NULL;
+char *_nlos2_libdir = NULL;
+char *_nlos2_localealiaspath = NULL;
+char *_nlos2_localedir = NULL;
 
 static __attribute__((constructor)) void
-os2_initialize ()
+nlos2_initialize ()
 {
   char *root = getenv ("UNIXROOT");
   char *gnulocaledir = getenv ("GNULOCALEDIR");
 
-  _os2_libdir = gnulocaledir;
-  if (!_os2_libdir)
+  _nlos2_libdir = gnulocaledir;
+  if (!_nlos2_libdir)
     {
       if (root)
         {
           size_t sl = strlen (root);
-          _os2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
-          memcpy (_os2_libdir, root, sl);
-          memcpy (_os2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
+          _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
+          memcpy (_nlos2_libdir, root, sl);
+          memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
         }
       else
-        _os2_libdir = LIBDIR;
+        _nlos2_libdir = LIBDIR;
     }
 
-  _os2_localealiaspath = gnulocaledir;
-  if (!_os2_localealiaspath)
+  _nlos2_localealiaspath = gnulocaledir;
+  if (!_nlos2_localealiaspath)
     {
       if (root)
         {
           size_t sl = strlen (root);
-          _os2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
-          memcpy (_os2_localealiaspath, root, sl);
-          memcpy (_os2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
+          _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
+          memcpy (_nlos2_localealiaspath, root, sl);
+          memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
         }
      else
-        _os2_localealiaspath = LOCALE_ALIAS_PATH;
+        _nlos2_localealiaspath = LOCALE_ALIAS_PATH;
     }
 
-  _os2_localedir = gnulocaledir;
-  if (!_os2_localedir)
+  _nlos2_localedir = gnulocaledir;
+  if (!_nlos2_localedir)
     {
       if (root)
         {
           size_t sl = strlen (root);
-          _os2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
-          memcpy (_os2_localedir, root, sl);
-          memcpy (_os2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
+          _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
+          memcpy (_nlos2_localedir, root, sl);
+          memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
         }
       else
-        _os2_localedir = LOCALEDIR;
+        _nlos2_localedir = LOCALEDIR;
     }
 
-  {
-    extern const char _nl_default_dirname__[];
-    if (strlen (_os2_localedir) <= LOCALEDIR_MAX)
-      strcpy (_nl_default_dirname__, _os2_localedir);
-  }
+  if (strlen (_nlos2_localedir) <= MAXPATHLEN)
+    strcpy (_nl_default_dirname__, _nlos2_localedir);
 }
index 3605e7a36615d4662506f393d413c0a9b447d2ba..4f74e8c037529ba1e7bfb5467e7ecb968f060eb0 100644 (file)
 #ifndef OS2_AWARE
 
 #undef LIBDIR
-#define LIBDIR                 _os2_libdir
-extern char *_os2_libdir;
+#define LIBDIR                 _nlos2_libdir
+extern char *_nlos2_libdir;
 
 #undef LOCALEDIR
-#define LOCALEDIR              _os2_localedir
-extern char *_os2_localedir;
+#define LOCALEDIR              _nlos2_localedir
+extern char *_nlos2_localedir;
 
 #undef LOCALE_ALIAS_PATH
-#define LOCALE_ALIAS_PATH      _os2_localealiaspath
-extern char *_os2_localealiaspath;
+#define LOCALE_ALIAS_PATH      _nlos2_localealiaspath
+extern char *_nlos2_localealiaspath;
 
 #endif