[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
- [PATCH 1/2] stat: use a CHAR instead of TCHAR with GetFinalPathNameByHandleA, Steve Lhomme, 2020/05/19
- [PATCH 2/2] stat: do not use LoadLibrary when built for Windows Store apps, Steve Lhomme, 2020/05/19
- Re: [PATCH 1/2] stat: use a CHAR instead of TCHAR with GetFinalPathNameByHandleA, Bruno Haible, 2020/05/27
- Re: [PATCH 1/2] stat: use a CHAR instead of TCHAR with GetFinalPathNameByHandleA, Jeffrey Walton, 2020/05/27
- Don't assume that UNICODE is not defined, Bruno Haible, 2020/05/30
- Re: Don't assume that UNICODE is not defined, Steve Lhomme, 2020/05/30
- Re: Don't assume that UNICODE is not defined, Bruno Haible, 2020/05/30
- Re: Don't assume that UNICODE is not defined, Steve Lhomme, 2020/05/30
- Re: Don't assume that UNICODE is not defined, Bruno Haible, 2020/05/30