groff
[Top][All Lists]
Advanced

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

[Groff] Re: setlocale problem in groff


From: Werner LEMBERG
Subject: [Groff] Re: setlocale problem in groff
Date: Sat, 12 Aug 2006 23:23:58 +0200 (CEST)

> I would introduce a macro that reflects the semantics that you want to
> use in preconv.cpp. Let's call it 'getlocale'.
> 
>   #ifdef HAVE_SETLOCALE
>     #include <locale.h>
>     #define getlocale(category) setlocale(category, NULL)
>   #else
>     #define setlocale(category, locale) (void)(category, locale)
>     #define getlocale(category) ((void)(category), "C")
>   #endif

Thanks!  My final code is this:

  #ifdef HAVE_SETLOCALE
  #include <locale.h>
  #define getlocale(category) setlocale(category, NULL)
  #else
  #define LC_ALL 0
  #define LC_CTYPE 0
  #define setlocale(category, locale) (void)(category, locale)
  #define getlocale(category) ((void)(category), (char *)"C")
  #endif


     Werner




reply via email to

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