The International Simutrans Forum

 

Author Topic: Experimental simsys_s.cc  (Read 1666 times)

0 Members and 1 Guest are viewing this topic.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1406
Experimental simsys_s.cc
« on: May 19, 2010, 03:17:10 PM »
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?


Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20385
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Experimental simsys_s.cc
« Reply #1 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.

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.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1406
Re: Experimental simsys_s.cc
« Reply #2 on: May 19, 2010, 11:18:00 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.


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???

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10337
  • Languages: De,EN,JP
Re: Experimental simsys_s.cc
« Reply #3 on: May 20, 2010, 12:34:52 PM »
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

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20385
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Experimental simsys_s.cc
« Reply #4 on: May 20, 2010, 11:38:50 PM »
Prissi - thank you for the advice. I have corrected this in the latest commit to the -devel branch.