Subject: Re: SDL troubles.
To: gabriel rosenkoetter <>
From: None <>
List: current-users
Date: 05/31/2001 16:29:50
> Hrm. Don't think it's needed, since they seem to have code that
> works on Linux and BEOS. (That is, they already did that work, just
> that NetBSD is getting categorized as "other" when is should fall
> under Unix.)

Right on!  Less work is good :)

> Does Linux define __unix__ somewhere? Why are they keying off that?
> (And where the hell does one look in /usr/include to find what *is*
> definied? I've been wondering this for years...)

It's actually built into the compiler, not in /usr/include.  Try:
	echo 'main(){}' >test.c;gcc -v test.c 2>&1|grep -- -D;rm test.c

If you want to be lazy instead of modifying multiple source files,
change CC and (CXX or CCC) from "gcc blah" to "gcc blah -D__unix__"
I think this is more foolproof than modifying CFLAGS and CXXFLAGS.

> Right now, I'm just adding || defined(__NetBSD__) to the tail end of
> all of these, but I'm positive this is inappropriate (there is a
> general symbol to check for, and our specific OS's name ain't it),
> so it'd be nice to know what the right thing is. (I'd like to make a
> package out of this software... it's the mult-OS port of Bungie's
> game Marathon, called AlephOne. The source I'm playing with is
> available from, listed
> as the "Linux" port at, though SDL is
> pretty clearly platform-independant, and the first web page
> definitely suggests is *should* run in "*BSDs".

Hey, the screenshots look okay.  I'll be glad to test your package
once you whip it up.

NetBSD: it isn't foolproof, but it doesn't graduate fools either