From: Michael Stefaniuc Subject: Re: [PATCH] gdi32: Reformat some strings to improve readability Message-Id: <201cc9ef-1e69-2e98-7282-455c26e7ba8f@winehq.org> Date: Fri, 12 Apr 2019 21:19:31 +0200 In-Reply-To: <2f257bee-0bbf-0322-94a8-a8245cd258bb@codeweavers.com> References: <20190401073518.27827-1-mstefani@winehq.org> <2f257bee-0bbf-0322-94a8-a8245cd258bb@codeweavers.com> Hello Jacek, On 4/12/19 5:07 PM, Jacek Caban wrote: > On 4/1/19 9:35 AM, Michael Stefaniuc wrote: >> Signed-off-by: Michael Stefaniuc >> --- >> No-op as gcc generates the exact same object files. >> Only gdiobj.c, font.c and freetype.c need "CFLAGS=-O2 -g0 -DNDEBUG" as >> they use asserts and the line count changes. > > > I miss this patch every time I need utf16 literal ;) Are you actually > planning on following up on this? yes, but I was waiting for comments from other developers. For the more convincing arguments. Though I hoped that some trusted maintainer takes the initiative and slips in an u"string" to see what breaks ;) And after a year I would start doing the mass conversion with a "we use them for > 1 year now"... > The compatibility is the obvious problem here. I would suggest to start > with a less controversial change and try to make TEXT() macro more > portable. Here are a few thoughts: > > > - You may use L"" form for all actual Windows compiler. It's supported > all versions of MSVC and mingw, so this would get those handled. (As a > side note, in C++, char16_t and wchar_t are different builtin types even > if wchar_t is 16-bit; this doesn't matter for Wine internal use, but it > means that we should use L"" form in headers whenever possible). Yeah, I wanted to look at something similar like __MSABI_LONG() # if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) ... # define __MSABI_WSTR(x) L ## x # else # define __MSABI_WSTR(x) u ## x # endif > > > - Recent and future C compilers should support u"", so we only need to > worry about old ones. The only known blocker is the mingw used on winehq.org to build the winetest.exe. As Alexandre works on the cross compile stuff I was hoping he'll have to upgrade that one anyway. > - If my quick search is right, u"" is available in GCC since version > 4.4. Earlier versions supported -fshort-wchar so we may use that in > combination with L"" form to get all GCC versions covered. > > > Having TEXT macro that's actually portable would be a convincing > argument to start using it in Wine. bye michael