Subject: pkg/35251: emulators/zsnes fails to compile on NetBSD-current (patch included)
To: None <,,>
From: <>
List: pkgsrc-bugs
Date: 12/13/2006 23:35:01
>Number:         35251
>Category:       pkg
>Synopsis:       emulators/zsnes fails to compile on NetBSD-current (patch included)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 13 23:35:00 +0000 2006
>Release:        NetBSD 4.99.5 i386

System: NetBSD 4.99.5 (GENERIC) #1: Wed Dec  6 11:56:19 EST 2006


emulators/zsnes fails to compile on my NetBSD-current ( 4.99.5 -D20061204-UTC ) system.
Error message is as follows.

cc -O2 -I/usr/pkg/include -DGLX_GLXEXT_LEGACY -I/usr/include -pipe -I. -Wall -I/usr/local/include -I/usr/include -D__LINUX__ -D__FreeBSD__  -I/usr/pkg/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D_THREAD_SAFE  -D__OPENGL__ -O3 -ffast-math -fomit-frame-pointer -fexpensive-optimizations -s -o linux/sdllink.o -c linux/sdllink.c
linux/sdllink.c:39: error: expected identifier before numeric constant
gmake: *** [linux/sdllink.o] Error 1
*** Error code 2

make: stopped in /usr/pkgsrc/emulators/zsnes

The problem is that the author defines an enumerated type that uses TRUE and FALSE that are already preprocessor defines that sneak in through the headers.

typedef enum { FALSE = 0, TRUE = 1 } BOOL;


cd /usr/pkgsrc/emulators/zsnes && make


You could muck around in all the .c files that define this enumerated type, but I find the easiest solution is simply to modify patches/patch-ab so that it adds the following to the end of the gblhdr.h file:

#undef TRUE
#undef FALSE

works fine for me.