Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[physac] MSVC compiler cannot compile this file correctly #1525

Closed
3 tasks done
object71 opened this issue Jan 11, 2021 · 3 comments
Closed
3 tasks done

[physac] MSVC compiler cannot compile this file correctly #1525

object71 opened this issue Jan 11, 2021 · 3 comments

Comments

@object71
Copy link
Contributor

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • My code has no errors or misuse of raylib

Issue description

When compiling with MSVC (generated projects with CMake) I and include physac.h I get the following errors:

D:\Projects\raylib-cpp\vendor\raylib\src\physac.h(410): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax

When any of these initializers are met: (Vector2){ 0.0f, 0.0f }

This is already solved in raylib.h by the following code

#if defined(__cplusplus)
    #define CLITERAL(type)      type
#else
    #define CLITERAL(type)      (type)
#endif

// ...

CLITERAL(Vector2){ 0.0f, 0.0f }

Environment

Happening on windows with VS2019 tools installed. Projects generated in cmake and also while trying to build raylib-cpp with all examples - but it is failing on raylib side not on the language port.

Code Example

Just clone raylib-cpp and build with examples without tests.

@raysan5 raysan5 changed the title [Physac.h] MSVC compiler cannot compile this file correctly [physac] MSVC compiler cannot compile this file correctly Jan 12, 2021
@raysan5
Copy link
Owner

raysan5 commented Jan 12, 2021

@object71 Yeah, physac library requires some review... Feel free to send a PR with this improvement.

@raysan5
Copy link
Owner

raysan5 commented Jan 20, 2021

@object71 Reviewed physac library, please, reopen if still fails.

@raysan5 raysan5 closed this as completed Jan 21, 2021
@object71
Copy link
Contributor Author

@raysan5 It is fine now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants