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

Fix compilability with /Zc:preprocessor #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sorokin
Copy link

@sorokin sorokin commented Nov 20, 2023

The code in array_macro.h assumed that definition of _MSC_VER macro implies that the traditional MSVC preprocessor is used.

This is not always the case. Since VS 2017 15.8 MSVC offers a new preprocessor which is standard conforming. The new mode is available with /Zc:preprocessor compiler option. Previously it was available with /experimental:preprocessor.

Availability of the new mode means that it is no longer enough to check only for the definition of _MSC_VER. One has to check the macro _MSVC_TRADITIONAL too.

This check is necessary since the macro that definitions of ENOKI_MAP_EXPR_NEXT_1 and ENOKI_MAP_STMT_NEXT_1 are otherwise incorrect and they don't work with standard conforming preprocessor.

The code in array_macro.h assumed that definition of _MSC_VER
macro implies that the traditional MSVC preprocessor is used.

This is not always the case. Since VS 2017 15.8 MSVC offers
a new preprocessor which is standard conforming. The new mode
is available with /Zc:preprocessor compiler option. Previously
it was available with /experimental:preprocessor.

Availability of the new mode means that it is no longer
enough to check only for the definition of _MSC_VER. One has
to check the macro _MSVC_TRADITIONAL too.

This check is necessary since the macro that definitions of
ENOKI_MAP_EXPR_NEXT_1 and ENOKI_MAP_STMT_NEXT_1 are otherwise
incorrect and they don't work with standard conforming
preprocessor.
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

Successfully merging this pull request may close these issues.

1 participant