bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stdlib self test: error: 'SIGTERM' undeclared


From: Bruno Haible
Subject: Re: stdlib self test: error: 'SIGTERM' undeclared
Date: Sun, 26 Sep 2010 14:30:09 +0200
User-agent: KMail/1.9.9

Hi Simon,

> gnulib-tool --create-testdir --dir m --with-tests stdlib; cd m ; ./configure 
> --host=i586-mingw32msvc --build=i686-pc-linux-gnu ; make
> 
> results in:
> 
> test-stdlib.c: In function ‘main’:
> test-stdlib.c:63: error: ‘SIGTERM’ undeclared (first use in this function)
> test-stdlib.c:63: error: (Each undeclared identifier is reported only once
> test-stdlib.c:63: error: for each function it appears in.)
> 
> the cause is gnulib's stdlib.h:
> 
> #ifndef WEXITSTATUS
> # include <sys/wait.h>
> #endif
> 
> and in turn gnulib's sys/wait.h:
> 
> # define WTERMSIG(x) SIGTERM
> 
> But sys/wait.h never includes <signal.h> to get SIGTERM.

Indeed, I agree with your analysis.

> Bruno, is the patch against the sys_wait module below OK?

I prefer to put the #include statement with the other one.
Committed this in your name:


2010-09-26  Simon Josefsson  <address@hidden>

        stdlib, sys_wait: Avoid compilation error on mingw.
        * lib/sys_wait.in.h: Include <signal.h>, for SIGTERM.

--- lib/sys_wait.in.h.orig      Sun Sep 26 14:25:45 2010
+++ lib/sys_wait.in.h   Sun Sep 26 13:53:52 2010
@@ -79,7 +79,8 @@
 #else
 /* Native Windows API.  */
 
-# include <process.h>
+# include <process.h> /* for _cwait, WAIT_CHILD */
+# include <signal.h> /* for SIGTERM */
 
 # define waitpid(pid,statusp,options) _cwait (statusp, pid, WAIT_CHILD)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]