Subject: pkg/35251: emulators/zsnes fails to compile on NetBSD-current (patch included)
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: dhowland@users.sourceforge.net <dhowland@users.sourceforge.net>
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
>Originator:     dhowland@users.sourceforge.net
>Release:        NetBSD 4.99.5 i386
>Organization:
>Environment:


System: NetBSD 4.99.5 (GENERIC) #1: Wed Dec  6 11:56:19 EST 2006
	root@micron:/usr/4.99/obj/sys/arch/i386/compile/GENERIC



>Description:


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

Stop.
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.

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



>How-To-Repeat:


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


>Fix:


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.