Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
Not every compiler can do math. Needs a more upstream friendly solution.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oggom committed Mar 12, 2015
1 parent 0cd9a7d commit 5b25217
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/burn/drv/konami/d_mystwarr.cpp
Expand Up @@ -32,6 +32,10 @@
#include <cmath>
#endif

#ifndef M_PI
#define M_PI 3.1415926536
#endif

static UINT8 *AllMem;
static UINT8 *Drv68KROM;
static UINT8 *DrvZ80ROM;
Expand Down
4 changes: 4 additions & 0 deletions src/burn/drv/pst90s/d_raiden2.cpp
Expand Up @@ -12,6 +12,10 @@
#include <cmath>
#endif

#ifndef M_PI
#define M_PI 3.1415926536
#endif

static UINT8 *AllMem;
static UINT8 *MemEnd;
static UINT8 *AllRam;
Expand Down

15 comments on commit 5b25217

@barbudreadmon
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, you want me to submit your changes upstream or you'll do it yourself ?

@Oggom
Copy link
Contributor Author

@Oggom Oggom commented on 5b25217 Mar 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If upstream ends up being responsive about those changes feel free to propose them.

@barbudreadmon
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's your compiler ?

@Oggom
Copy link
Contributor Author

@Oggom Oggom commented on 5b25217 Mar 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSYS2/MinGW-w64

@barbudreadmon
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, following what they told me upstream, i changed how we handle this M_PI undef hack, could you try to rebuild and tell me if that works ?

@Oggom
Copy link
Contributor Author

@Oggom Oggom commented on 5b25217 Mar 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not work unfortunately.
An alternative solution would be simply using 3.1415926536 instead of M_PI in the first place.

@barbudreadmon
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, best solution would be to not modify the code from "vanilla" fba. What error does it return ?

@Oggom
Copy link
Contributor Author

@Oggom Oggom commented on 5b25217 Mar 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/burn/drv/konami/d_mystwarr.cpp: In function 'void K055550_word_write(INT32, UINT16, UINT16)':
src/burn/drv/konami/d_mystwarr.cpp:753:57: error: 'M_PI' was not declared in this scope
angle = (INT32)((atan((double)dy / dx) * 128.0) / M_PI);
^
Makefile.libretro:572: recipe for target 'src/burn/drv/konami/d_mystwarr.o' failed

@barbudreadmon
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please try again ? It seems M_PI undefined could be an issue caused by -std=c++11 compiler option.

@inactive123
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh dear, does FBA require C++11 now?

@barbudreadmon
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mips3 needs c++11, but we can disable it for now since it is still WIP.

@Oggom
Copy link
Contributor Author

@Oggom Oggom commented on 5b25217 Mar 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's compiling now, thanks.

@barbudreadmon
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you should think about moving to another compiler, c++11 will probably be required for v0.2.97.36, and your compiler seems to handle c++11 badly.

@Alcaro
Copy link
Contributor

@Alcaro Alcaro commented on 5b25217 Mar 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd be glad to if we could, but there are no C++11 compilers for some of the platforms we're targeting. PS3 and BlackBerry, for example.

@barbudreadmon
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll use std=c++11 only for fba-libretro mips3-enabled then, seems like mips3 will be a dynarec only available for x86/x86_64 (and perhaps arm).

Please sign in to comment.