We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 924

Summary: No _SC_NPROCESSORS_ONLN on OSX 10.4
Product: SDL Reporter: Kai Sterker <kai.sterker>
Component: *don't know*Assignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: PowerPC   
OS: Mac OS X 10.4 (PPC)   

Description Kai Sterker 2010-01-05 10:04:05 UTC
Build of SDL 1.3 rev 5441 broken on OSX 10.4.11. I get

libtool: compile:  gcc -g -O2 -I./include -maltivec -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/usr/X11R6/include -D_THREAD_SAFE -falign-loops=16 -force_cpusubtype_ALL -fpascal-strings -MMD -MT build/SDL_cpuinfo.lo -c src/cpuinfo/SDL_cpuinfo.c  -fno-common -DPIC -o build/.libs/SDL_cpuinfo.o
src/cpuinfo/SDL_cpuinfo.c: In function 'SDL_GetCPUCount':
src/cpuinfo/SDL_cpuinfo.c:313: error: '_SC_NPROCESSORS_ONLN' undeclared (first use in this function)
src/cpuinfo/SDL_cpuinfo.c:313: error: (Each undeclared identifier is reported only once
src/cpuinfo/SDL_cpuinfo.c:313: error: for each function it appears in.)
make: *** [build/SDL_cpuinfo.lo] Error 1

Unlike 'man 3 sysconf' suggests, there is no such definition in unistd.h. Haven't digged much, but Google seems to confirm that.

I guess configure.in needs a special check for this case, so that HAVE_SYSCONF will not be set when it shouldn't be. (manually changing include/SDL_config.h accordingly got me over this issue)
Comment 1 Sam Lantinga 2010-01-05 20:33:41 UTC
This is fixed in revision 5443, thanks!