Author Topic: [portability patch proposal] Not every compiler can do math  (Read 3933 times)

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
[portability patch proposal] Not every compiler can do math
« on: March 12, 2015, 02:51:41 PM »
For portability, as mentioned on https://github.com/libretro/libretro-fba/commit/5b2521720a884fb5e1dd2fcfefaf0d7d1a9b000a , you could add :
Code: [Select]
#ifndef M_PI
 #define M_PI 3.1415926536
#endif
after including <cmath> in d_mystwarr.cpp and d_raiden2.cpp

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: [portability patch proposal] Not every compiler can do math
« Reply #1 on: March 12, 2015, 04:54:12 PM »
Would it not work to add that to your burn_endian.h header?
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: [portability patch proposal] Not every compiler can do math
« Reply #2 on: March 13, 2015, 08:20:21 AM »
Commited your suggestion to git, but i have no MSYS2/MinGW-w64 toolchain to test. I asked for feedback and hope things go well.

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: [portability patch proposal] Not every compiler can do math
« Reply #3 on: March 13, 2015, 02:06:19 PM »
Disabling "-std=c++11" for now did the trick (moving M_PI def to burn_endian didn't). But we'll have this issue again when mips3 won't be a WIP anymore (seems like it needs -std=c++11 to compile).

Offline Romhack

  • Expert
  • *****
  • Posts: 92
  • Karma: +49/-0
Re: [portability patch proposal] Not every compiler can do math
« Reply #4 on: March 13, 2015, 08:34:11 PM »
Disabling "-std=c++11" for now did the trick (moving M_PI def to burn_endian didn't). But we'll have this issue again when mips3 won't be a WIP anymore (seems like it needs -std=c++11 to compile).
Only for nullptr and auto on some places, and IIRC <cstdint> and others :) . Easy.
You can also use "-std=gnu++0x" (C++11 with GNU extensions)
« Last Edit: March 13, 2015, 08:49:28 PM by Romhack »