GarageGames / Torque2D

MIT Licensed Open Source version of Torque 2D game engine from GarageGames
MIT License
1.67k stars 1.56k forks source link

On some platforms time.h seems to get included. Avoid time() collision. #292

Closed bentley closed 8 years ago

bentley commented 8 years ago

I hit this on OpenBSD:

gcc -c -I../../lib/ljpeg -I../../source/persistence/rapidjson/include -I../../source -I/usr/local/include -ggdb -DTORQUE_DEBUG -DTORQUE_DEBUG_GUARD -DTORQUE_NET_STATS ../../source/platformX86UNIX/x86UNIXCPUInfo.cc -o Debug/platformX86UNIX/x86UNIXCPUInfo.cc.o
../../source/platformX86UNIX/x86UNIXCPUInfo.cc:42: error: 'U32 time [2]' redeclared as different kind of symbol
/usr/include/time.h:136: error: previous declaration of 'time_t time(time_t*)'
../../source/platformX86UNIX/x86UNIXCPUInfo.cc: In static member function 'static void Processor::init()':
../../source/platformX86UNIX/x86UNIXCPUInfo.cc:62: error: pointer to a function used in arithmetic
../../source/platformX86UNIX/x86UNIXCPUInfo.cc:62: error: assignment of function 'time_t time(time_t*)'
../../source/platformX86UNIX/x86UNIXCPUInfo.cc:62: error: cannot convert 'int' to 'time_t ()(time_t*)' in assignment
Torque2D:464: recipe for target 'Debug/platformX86UNIX/x86UNIXCPUInfo.cc.o' failed
gmake: *** [Debug/platformX86UNIX/x86UNIXCPUInfo.cc.o] Error 1
chaigler commented 8 years ago

Closing this one as well, duplicated in #302.