bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* conflicting types in windows-spawn
@ 2021-05-06 12:28 Markus Mützel
  2021-05-06 13:25 ` Markus Mützel
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Mützel @ 2021-05-06 12:28 UTC (permalink / raw)
  To: bug-gnulib

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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-14 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 12:28 conflicting types in windows-spawn Markus Mützel
2021-05-06 13:25 ` Markus Mützel
2021-05-14 10:39   ` Bruno Haible
2021-05-14 15:38     ` Markus Mützel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).