News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Experimental simsys_s.cc

Started by TurfIt, May 19, 2010, 03:17:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TurfIt

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?


jamespetts

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.

TurfIt

Quote from: jamespetts on May 19, 2010, 10:47:26 PM
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.


Quote from: jamespetts on May 19, 2010, 10:47:26 PM
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 encompassing 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???

prissi

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

jamespetts

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.