Skip to main content
Topic: Experimental simsys_s.cc (Read 2713 times) previous topic - next topic

Experimental simsys_s.cc

WTF was done to Experimentals simsys_s.cc...
System libraries included by hard coded paths....
Ifdefs that result in the entire file skipping compilation....
WTF???

Restoring to the relevant code from Standard works just fine. Is there some reason for Experimentals butchery?


Re: Experimental simsys_s.cc

Reply #1
I did this a long time ago to get it to work properly on my machine: I couldn't work out how to make it work without doing that. Note that only the SDL build on Windows is affected because of the use of conditional compilation.

To which #ifdefs do you refer that result in the entire file being skipped? simsys_s.cc is only supposed to be used if Simutrans is compiled with SDL, not GDI. In most cases on Windows, GDI is preferable, but some people prefer SDL. The file is supposed to be ignored in Windows unless the pre-compiler directive "SDL" is specified.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

 

Re: Experimental simsys_s.cc

Reply #2
I did this a long time ago to get it to work properly on my machine: I couldn't work out how to make it work without doing that. Note that only the SDL build on Windows is affected because of the use of conditional compilation.

I would guess you either don't have the include paths set right in your compiler environment or have installed SDL in the wrong place.
#include <SDL/SDL.h> should work. Hardcoding  #include "../SDL-1.2.13/include/SDL.h" just breaks things for everyone else.

The conditional compilation for all these target specific files is controlled in the makefile by config.default. i.e. Setting BACKEND=sdl results in simsys_s.cc being added to the source list.


To which #ifdefs do you refer that result in the entire file being skipped? simsys_s.cc is only supposed to be used if Simutrans is compiled with SDL, not GDI. In most cases on Windows, GDI is preferable, but some people prefer SDL. The file is supposed to be ignored in Windows unless the pre-compiler directive "SDL" is specified.

#ifdef SDL is encomp****ing the whole thing.  SDL is defined inside a #ifndef WIN32 statement. This must not evaluate to true in my environment - MinGW, SDL.
I also note WIN32 and _WIN32 both being used???

Re: Experimental simsys_s.cc

Reply #3
The include path of SDL can be easily added to the environment in MSVC. Especially, since everybody is free to them anyplace they like. Options->Environment Or manipulate the path in the inlude directoryies on the compiler properties

Re: Experimental simsys_s.cc

Reply #4
Prissi - thank you for the advice. I have corrected this in the latest commit to the -devel branch.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.