The International Simutrans Forum

 

Author Topic: Fix for pre-C++11 compilers  (Read 384 times)

0 Members and 1 Guest are viewing this topic.

Offline ceeac

  • Devotee
  • *
  • Posts: 135
Fix for pre-C++11 compilers
« on: March 11, 2020, 04:02:07 PM »
Fixes compilation when using compilers that do not enable C++11 or newer by default (or when using -std=c++03 explicitly), like the macOS nightly build.

Offline Freahk

  • Devotee
  • *
  • Posts: 1059
  • Languages: DE, EN
Re: Fix for pre-C++11 compilers
« Reply #1 on: March 11, 2020, 04:36:16 PM »
Tbh I am not quite sure why simutrans still builds against an ancient standard on macOS. Windows and Linux builds seem to target C++11.
Changing the std for macOS builds to C++11 (or even newer) should be preferred over backporting to C++03 and

This is just my opinion. Usually I don't care about macOS at all, so there might be some macOS specific pitfalls I did not consider.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9993
  • Languages: De,EN,JP
Re: Fix for pre-C++11 compilers
« Reply #2 on: March 12, 2020, 12:59:18 PM »
Since there are no newer servers for Mac OS, I have to use whatever Github offers me. Anyway, for portability not using extensions is the best.

Ok, I have rather to define the structure by hand. Stupid ...
« Last Edit: March 12, 2020, 01:39:21 PM by prissi »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4702
  • Languages: EN, DE, AT
Re: Fix for pre-C++11 compilers
« Reply #3 on: March 29, 2020, 10:25:24 AM »
why is there a union anyway? Memory consumption should not be an issue here.