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

Compile Errors with MSVC - Erroneous Macros #4

Open
Code4Cookie opened this issue Jan 1, 2024 · 0 comments
Open

Compile Errors with MSVC - Erroneous Macros #4

Code4Cookie opened this issue Jan 1, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Code4Cookie
Copy link

Code4Cookie commented Jan 1, 2024

Architecture: Tested on both x86 & x64
OS: Windows
IDE: Visual Studio 2022
C++ Standard: 14

A number of compile errors are thrown when attempting to compile a C++ source file that includes both harbol_common_defines.h and a standard STL header.

I have located the erroneous macros:

# define restrict __restrict

# define inline __inline

The interfering _CRTRESTRICT macro of corecrt.h:

#define _CRTRESTRICT __declspec(restrict)

By defining _CRT_SUPPRESS_RESTRICT the macro will be excluded from the build, a possible solution. However, I am unsure if it would break compatibility with other libraries.

In regards to inlining, the C++ standard library forbids macroizing the keyword "inline," according to xkeycheck.h:

#if defined(inline) #define inline EMIT WARNING C4005 #error The C++ Standard Library forbids macroizing the keyword "inline". \ Enable warning C4005 to find the forbidden define. #endif // inline

@assyrianic assyrianic added the enhancement New feature or request label Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants