The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Dwachs on August 13, 2013, 06:25:14 PM

Title: compile problem in simthread.cc
Post by: Dwachs on August 13, 2013, 06:25:14 PM
Nightly server has troubles to compile simthread.cc. See the log-files:

http://simutrans-germany.com/stn/data/compile.log.macintel.txt
http://simutrans-germany.com/stn/data/compile.log.macpowerpc.txt
http://simutrans-germany.com/stn/data/compile.log.gcc3.txt

Dont know how to fix.
Title: Re: compile problem in simthread.cc
Post by: TurfIt on August 13, 2013, 06:45:03 PM
makefile needs to exclude simthread.cc when not MULTI_THREAD.
Title: Re: compile problem in simthread.cc
Post by: Ters on August 13, 2013, 06:48:50 PM
Or just wrap the entire file with an #if MULTI_THREAD>1, which is uglier, but perhaps more friendly towards IDEs.
Title: Re: compile problem in simthread.cc
Post by: Dwachs on August 13, 2013, 06:50:52 PM
On my system the check

#if _POSIX_BARRIERS>0

does not work: the hand-written barriers get compiled although  _POSIX_BARRIERS is defined by

#define _POSIX_BARRIERS 200809L

I cannot get this check to work properly ???
Title: Re: compile problem in simthread.cc
Post by: TurfIt on August 13, 2013, 06:56:08 PM
I've seen:
/* Have problems using posix barriers when symbol value is 200112L */
/* This requires more investigation, but will work for the moment */
#if defined(_POSIX_BARRIERS) && ( (_POSIX_BARRIERS - 20012L) >= 0 && _POSIX_BARRIERS != 200112L)
#define _POSIX_BARRIERS_MINE

floating around the great internet. Exactly what it does who knows...
Title: Re: compile problem in simthread.cc
Post by: Ters on August 13, 2013, 07:09:48 PM
Is the preprocessor supposed to be smart enough to recognize L as a legal part of a numeric value?
Title: Re: compile problem in simthread.cc
Post by: Dwachs on August 13, 2013, 07:25:10 PM
The header file that defines _POSIX_BARRIERS is not included ...

Preprocessor can work with L

Edit: Hopefully fixed with r6646