enoki icon indicating copy to clipboard operation
enoki copied to clipboard

Fix compilability with /Zc:preprocessor

Open sorokin opened this issue 2 years ago • 0 comments

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.

sorokin avatar Nov 20 '23 20:11 sorokin