bug-gnulib
[Top][All Lists]
Advanced

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

Re: Don't assume that UNICODE is not defined


From: Jeffrey Walton
Subject: Re: Don't assume that UNICODE is not defined
Date: Sat, 30 May 2020 06:57:25 -0400

On Sat, May 30, 2020 at 5:16 AM Bruno Haible <bruno@clisp.org> wrote:
>
> I wrote:
> > some types depend on
> > whether UNICODE is defined or not [1].
>
> Some functions also depend whether UNICODE is defined or not.
>
> Since UWP applications are meant to defined the macro UNICODE, but we want
> Gnulib to produce the same code, regardless whether UNICODE is defined or not,
> we need to either explicitly use the functions with 'A' suffix (which is ugly)
> or use #defines for redirection.
>
> Fortunately, packages that use gnulib don't need to do this stuff; nor do we
> need to do it in the tests/ directory. Only the gnulib/lib/ directory may
> reasonably be used with -DUNICODE, therefore only the gnulib/lib/ directory
> needs this workaround.

In case it matters, I believe Microsoft keys on _UNICODE, not UNICODE.

Microsoft source files often have something like this (or is it vice-versa):

#ifdef UNICODE
#  ifndef _UNICODE
#    define _UNICODE
#  endif
#endif

Also see 
https://docs.microsoft.com/en-us/cpp/text/generic-text-mappings-in-tchar-h.

Jeff



reply via email to

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