[PATCH 4/5] include: improve errors when TEXT()/OLESTR() aren't implementable.

Kevin Puetz PuetzKevinA at johndeere.com
Thu Jul 16 20:26:53 CDT 2020


Sorry, apparently git quiltimport cuts at the --- too, so the motive I 
intended 
to explain on the submission (but not the git commit message) got left out.

---

Omitting these macros entirely (as done with the _tcs* functions) may
produce poor error messages, particularly when used to define literals
in initializer contexts where functions calls are not allowed, like
TCHAR foo[] = TEXT("hello");

I also considered prototyping an unimplemented function, e.g.
const TCHAR *TEXT(...) __attribute__((error ("...")));
But that's gcc-specific, still fails in some initializer cases,
and I see no similar existing usage of __attribute__((error)) in wine,
so the minor advantage doesn't seem worth the portability issues.



More information about the wine-devel mailing list