gettext
8bf133ed - intl: On native Windows, actually define the *wprintf functions.

Commit
2 years ago
intl: On native Windows, actually define the *wprintf functions. In dcaf8c4d7 (Cygwin portability., 2003-09-17), the *wprintf() family of functions in `gettext-runtime/intl/printf.c` were no longer guarded by the constant `HAVE_WPRINTF`, but instead by `HAVE_FWPRINTF`. This apparently worked even if the corresponding part in `gettext-runtime/intl/libgnuintl.h.in` uses `HAVE_WPRINTF` to guard the declarations of those functions. However, in d84f20745 (Make sure that libintl.h declares the *wprintf overrides on Windows., 2019-04-08), gettext introduced a change where it would look for `wprintf()` instead of `fwprintf()`. As a consequence it would no longer define the `HAVE_FWPRINTF` constant at all. GCC apparently interprets `#if HAVE_FWPRINTF` as `#if 0` if the constant has not even been defined. This leads to the funny situation that previously, the *wprintf() functions would be defined, but not be declared. Whereas now the functions are not defined, but declared. Also funny: Cygwin did not even export the `fwprintf()` function until 2009, as per Cygwin's 45e20e47ba (cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf. [...] , 2009-03-06), while the `wprintf()` function was exported already in 2003. So the Cygwin portability patch from 2003 seems to have turned off all of the *wprintf() functions in gettext. Let's revert that "portability" patch, as it now only does harm and has no benefit anymore. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> [Bruno's summary] Thank you for the analysis and explanation, Johannes! The commits dcaf8c4d7 and f5ca7696d (2003-09-17) introduced a test for fwprintf rather than wprintf. This was designed as a workaround to a Cygwin problem that existed from 2003 to 2009. The commit d84f20745 (2019-04-08) switched back from testing fwprintf to testing wprintf, but did so incompletely: I forgot to modify printf.c. So, since then, the *wprintf functions are declared but not defined.
Author
Committer
Parents
Loading