victorfisac / Physac

2D physics header-only library for videogames developed in C using raylib library.
http://www.victorfisac.com/physac
MIT License
432 stars 28 forks source link

Physac functions conflict with Visual Studio WINAPI function names #49

Closed ghost closed 3 years ago

ghost commented 3 years ago

OK, This issue/problem is weirdest issue i had...

Doing game template with C99 for Visual Studio 2019, I added physac.h with being standalone via defining PHYSAC_STANDALONE, But when building solution i get type conflict errors

Screenshot (369)

The problem with both functions GetCurrentTime and GetTimeCount, Anyway... When i went to their definition, I found that both names used by Windows API functions via WinBase.h, As you see in the image below

Screenshot (370)

So yes, Windows API functions use these names, To solve this i renamed GetCurrentTime to CurrentTime and renamed GetTimeCount to TimeCount everywhere in physac.h

Do you have idea to solve this by checking for Windows platform or Windows API, Tell me...

ghost commented 3 years ago

@victorfisac This issue is long time ago, Sorry for ping but really need ya to take look at this...

ghost commented 3 years ago

Fixed it on my own fork, Closing the issue...