From: Bruno Haible Date: Fri, 15 Mar 2002 18:32:24 +0000 (+0000) Subject: OS/2 update from Andrew Zabolotny . X-Git-Tag: 0.11.2-branchpoint~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80f98cac13c76b6f17d38df44576043ad9784119;p=thirdparty%2Fgettext.git OS/2 update from Andrew Zabolotny . --- diff --git a/intl/ChangeLog b/intl/ChangeLog index d99a9cdbc..119b3b476 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,9 @@ +2002-03-15 Andrew Zabolotny + + * os2compat.h: Use prefix _nlos2 instead of _os2, to avoid any + possible name clashes. + * os2compat.c: Likewise. + 2002-03-15 Bruno Haible * libgnuintl.h (LC_MESSAGES): Don't define on Solaris 2.5, to avoid diff --git a/intl/os2compat.c b/intl/os2compat.c index 681e98aea..3ca826666 100644 --- a/intl/os2compat.c +++ b/intl/os2compat.c @@ -23,6 +23,7 @@ #include #include +#include /* 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); } diff --git a/intl/os2compat.h b/intl/os2compat.h index 3605e7a36..4f74e8c03 100644 --- a/intl/os2compat.h +++ b/intl/os2compat.h @@ -21,16 +21,16 @@ #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