[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
conflicting types in windows-spawn
From: |
Markus Mützel |
Subject: |
conflicting types in windows-spawn |
Date: |
Thu, 6 May 2021 14:28:45 +0200 |
I tried to use the windows-spawn module in a project that defines UNICODE.
Compilation of gnulib failed with the following error:
libtool: compile: x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I.
-I/home/osboxes/Octave/mxe-octave/tmp-default-octave/octave-7.0.0/libgnu -I..
-I/home/osboxes/Octave/mxe-octave/usr/x86_64-w64-mingw32/include
-fvisibility=hidden -g -O2 -MT windows-spawn.lo -MD -MP -MF
.deps/windows-spawn.Tpo -c
/home/osboxes/Octave/mxe-octave/tmp-default-octave/octave-7.0.0/libgnu/windows-spawn.c
-DDLL_EXPORT -DPIC -o .libs/windows-spawn.o
/home/osboxes/Octave/mxe-octave/tmp-default-octave/octave-7.0.0/libgnu/windows-spawn.c:415:1:
error: conflicting types for 'compose_handles_block'
415 | compose_handles_block (const struct inheritable_handles *inh_handles,
| ^~~~~~~~~~~~~~~~~~~~~
In file included from
/home/osboxes/Octave/mxe-octave/tmp-default-octave/octave-7.0.0/libgnu/windows-spawn.c:21:
/home/osboxes/Octave/mxe-octave/tmp-default-octave/octave-7.0.0/libgnu/windows-spawn.h:118:12:
note: previous declaration of 'compose_handles_block' was here
118 | extern int compose_handles_block (const struct inheritable_handles
*inh_handles,
| ^~~~~~~~~~~~~~~~~~~~~
make[5]: *** [Makefile:3299: windows-spawn.lo] Error 1
The following change fixes it for me:
* lib/windows-spawn.h: Use ANSI structure STARTUPINFOA.
---
lib/windows-spawn.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/windows-spawn.h b/lib/windows-spawn.h
index 1c29d1b17..78f11893c 100644
--- a/lib/windows-spawn.h
+++ b/lib/windows-spawn.h
@@ -25,6 +25,9 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+/* Don't assume that UNICODE is not defined. */
+#undef STARTUPINFO
+#define STARTUPINFO STARTUPINFOA
/* Prepares an argument vector before calling spawn().
Markus
- conflicting types in windows-spawn,
Markus Mützel <=