Skip to content

Build failure on OpenBSD: SIGWINCH #110

Description

@vext01
$ ./waf
Waf: Entering directory `/home/edd/source/termbox/build'
[ 1/12] c: src/termbox.c -> build/src/termbox.c.1.o
[ 2/12] c: src/utf8.c -> build/src/utf8.c.1.o
[ 3/12] c: src/termbox.c -> build/src/termbox.c.2.o
[ 4/12] c: src/utf8.c -> build/src/utf8.c.2.o
../src/termbox.c: In function 'tb_init_fd':
../src/termbox.c:99: error: 'SIGWINCH' undeclared (first use in this function)
../src/termbox.c:99: error: (Each undeclared identifier is reported only once
../src/termbox.c:99: error: for each function it appears in.)

../src/termbox.c: In function 'tb_init_fd':
../src/termbox.c:99: error: 'SIGWINCH' undeclared (first use in this function)
../src/termbox.c:99: error: (Each undeclared identifier is reported only once
../src/termbox.c:99: error: for each function it appears in.)

Waf: Leaving directory `/home/edd/source/termbox/build'
Build failed
 -> task in 'termbox_shared' failed (exit status 1): 
        {task 7395741466256: c termbox.c -> termbox.c.1.o}
['/usr/bin/gcc', '-std=gnu99', '-Wall', '-Wextra', '-D_XOPEN_SOURCE', '-O3', '-fPIC', '../src/termbox.c', '-c', '-o', '/home/edd/source/termbox/build/src/termbox.c.1.o']
 -> task in 'termbox_static' failed (exit status 1): 
        {task 7395741577296: c termbox.c -> termbox.c.2.o}
['/usr/bin/gcc', '-std=gnu99', '-Wall', '-Wextra', '-D_XOPEN_SOURCE', '-O3', '../src/termbox.c', '-c', '-o', '/home/edd/source/termbox/build/src/termbox.c.2.o']

The fix is to set __BSD_VISIBLE to 1 before including <signal.h>.

In <signal.h>:

...
#define	SIGVTALRM 26	/* virtual time alarm */
#define	SIGPROF	27	/* profiling time alarm */
#if __BSD_VISIBLE
#define SIGWINCH 28	/* window size changes */
#define SIGINFO	29	/* information request */
#endif
#define SIGUSR1 30	/* user defined signal 1 */
#define SIGUSR2 31	/* user defined signal 2 */
...

Cheers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions