MiguelMJ / Candle

2D lighting for SFML
http://www.miguelmj.dev/Candle/
MIT License
130 stars 8 forks source link

M_PI is non-standard #3

Closed eXpl0it3r closed 3 years ago

eXpl0it3r commented 3 years ago

You're using M_PI in parts of the code, unfortunately this constant isn't really defined in the standard and while available in most compilers, some compilers, like MSVC require additional steps to use it. On top of that, since you use M_PI in a header file, the library user now also has to deal with it in their codebase.

Steps to Reproduce

Build Candle with MSVC (2019)

Actual Behavior

RadialLight.cpp(24,22): error C2065: 'M_PI': undeclared identifier
Line.cpp(14,30): error C2065: 'M_PI': undeclared identifier
Line.cpp(15,43): error C2065: 'M_PI': undeclared identifier
Line.cpp(15,56): error C2065: 'M_PI': undeclared identifier
Line.cpp(17,20): error C2065: 'M_PI': undeclared identifier

Expected Behavior

Candle builds without errors

Solutions

MiguelMJ commented 3 years ago

Thanks for pointing it out! I appreciate it so much.

MiguelMJ commented 3 years ago

@all-contributors please add @eXpl0it3r for bug

allcontributors[bot] commented 3 years ago

@MiguelMJ

I've put up a pull request to add @eXpl0it3r! :tada: