bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using gnulib on non posix/gnu systems


From: Juan Manuel Guerrero
Subject: using gnulib on non posix/gnu systems
Date: Thu, 27 Apr 2006 01:12:17 +0200
User-agent: KMail/1.8.2

I have used the getopt.[ch] files to port certain posix/gnu stuff
to DJGPP/MSDOS. The compilation of getopt.c fails because in the
design of this file it is assumed that NLS support is available either
through the system libc library or through ported versions of gettext
and iconv libraries. On MSDOS/WINDOWS systems this can not always
be assumed to be true. If the design goal of gnulib is really to ease the
required porting work from posix/gnu systems to non-posix systems then
some care must be taken concerning about this kind of assumptions about
existing functionality.
The patch below shows the source of the trouble and the way I have tried
to fix it. Please note that I am not claiming that this is the right way to fix
the issue. I even do not know if this is an issue at all.
If the maintainers should decide that this issue is worth to be concidered
then it should be clear that all files that offer NLS must be inspected
and changed accordingly.

Regards,
Juan M. Guerrero


diff -aprNU5 gnulib.orig/lib/getopt.c gnulib/lib/getopt.c
--- gnulib.orig/lib/getopt.c    2006-04-26 21:13:56 +0000
+++ gnulib/lib/getopt.c 2006-04-26 22:34:12 +0000
@@ -36,12 +36,16 @@
 #endif
 
 #ifdef _LIBC
 # include <libintl.h>
 #else
-# include "gettext.h"
-# define _(msgid) gettext (msgid)
+# ifdef HAVE_GETTEXT
+#  include "gettext.h"
+#  define _(msgid) gettext (msgid)
+# else
+#  define _(msgid) (msgid)
+# endif
 #endif
 
 #if defined _LIBC && defined USE_IN_LIBIO
 # include <wchar.h>
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]