scnlib icon indicating copy to clipboard operation
scnlib copied to clipboard

Remove integer digit separator from preprocessor macro. Fix build with Clang

Open Delta-dev-99 opened this issue 1 year ago • 0 comments

This pull request solves this issue

This commit reverts the definition of SCN_COMPILER in pp_detect.h to what it was before commit https://github.com/eliaskosunen/scnlib/commit/1c3280ef4df45a40a2837eaf8f32593f727f906e Direct link to file change reverted: include/scn/detail/pp_detect.h

The usage of the single-quote character as integer digit separator in preprocessor, results in build errors with Clang. (tested with clang versions 17,18 and 19). This probably happens because the preprocessor doesn't interpret the definition as an integer. The error is generated by the dependency scanner.

Another proposal:

Instead of reverting, another option to increase readability would be to use binary power, instead of base 10, for the version number, although the result would be different. Example: ( ((major) << 32) + ((minor) << 16) + (patch) )

Delta-dev-99 avatar Apr 13 '24 20:04 Delta-dev-99