]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libasprintf: Avoid compilation error on mingw with -D__USE_MINGW_ANSI_STDIO=1.
authorBruno Haible <bruno@clisp.org>
Sat, 18 May 2019 15:25:10 +0000 (17:25 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Apr 2020 10:47:51 +0000 (12:47 +0200)
* gettext-runtime/libasprintf/lib-asprintf.c (asprintf, vasprintf): Don't define
on mingw when __USE_MINGW_ANSI_STDIO is non-zero.

gettext-runtime/libasprintf/lib-asprintf.c

index 54649659bca5a800c2154257980b04e88754a5a1..c2fe4ed161f2716df3d5a96890154aa55c0fc656 100644 (file)
@@ -1,5 +1,5 @@
 /* Library functions for class autosprintf.
-   Copyright (C) 2002-2003, 2006, 2018 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2006, 2018-2019 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify
 #include "asprintf.c"
 
 /* Define the same functions also without the 'libasprintf_' prefix,
-   for binary backward-compatibility.  */
+   for binary backward-compatibility.
+   But don't redefine functions already defined by mingw.  */
+#if !(defined __MINGW32__ && __USE_MINGW_ANSI_STDIO)
 #undef asprintf
 #undef vasprintf
 #include "vasprintf.c"
 #include "asprintf.c"
+#endif
 
 #endif