Fix MinGW build broken by integration of 'stdio-consolesafe'

* src/conf_post.h: Avoid redirecting '*printf' functions if
'OMIT_CONSOLESAFE' is defined to 1.
* nt/cmdproxy.c:
* nt/ddeclient.c: Define 'OMIT_CONSOLESAFE' to 1 to avoid
redirecting '*printf functions' to stdio-consolesafe replacements.
* nt/Makefile.in (LIBS_ADDPM): Add -lgnu to link 'addpm' against
Gnulib.  (Bug#79855)
This commit is contained in:
Eli Zaretskii 2025-11-18 16:19:20 +02:00
parent 3ae79b7c05
commit 0026445dd6
4 changed files with 9 additions and 2 deletions

View file

@ -139,7 +139,7 @@ EMACS_MANIFEST = @EMACS_MANIFEST@
WINDRES = @WINDRES@
## Extra libraries to use when linking addpm.
LIBS_ADDPM = -lole32 -luuid
LIBS_ADDPM = -L../lib -lgnu -lole32 -luuid
## Compilation and linking flags
BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \

View file

@ -28,6 +28,10 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#define DEFER_MS_W32_H
/* We don't want to use the stdio-consolesafe redefinitions of *printf
functions, since (a) that pulls in stdio, which we don't want, see
below; and (b) we have our own implementations of *printf here. */
#define OMIT_CONSOLESAFE 1
#include <config.h>
#include <windows.h>

View file

@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#define DEFER_MS_W32_H
/* We only ever use fprintf for a fixed usage message below, so the
stdio-consolesafe module is overkill. */
#define OMIT_CONSOLESAFE 1
#include <config.h>
#include <windows.h>

View file

@ -397,7 +397,7 @@ extern int emacs_setenv_TZ (char const *);
: S_ISSOCK (mode) ? DT_SOCK : DT_UNKNOWN)
#endif /* MSDOS */
#if defined WINDOWSNT
#if defined WINDOWSNT && !(defined OMIT_CONSOLESAFE && OMIT_CONSOLESAFE == 1)
# if !defined _UCRT
# include <stdarg.h>
# include <stdio.h>