We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
_CCCL_PRAGMA
General CCCL
In the code base, for MSVC it is prefered to use __pragma over standard _Pragma. This leads to code duplication in many cases.
__pragma
_Pragma
Provide compiler independent _CCCL_PRAGMA macro implemented as (or something similar):
#define _CCCL_STRINGIFY2(x) #x #define _CCCL_STRINGIFY(x) _CCCL_STRINGIFY2(x) #ifdef _CCCL_COMPILER_MSVC # define _CCCL_PRAGMA(x) __pragma(x) #else # define _CCCL_PRAGMA(x) _Pragma(_CCCL_STRINGIFY(x)) #endif
It may be used as:
#ifdef _CCCL_COMPILER_MSVC _CCCL_PRAGMA(message("Hi from MSVC")) #else _CCCL_PRAGMA(message "Hi from other compiler") #endif
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Is this a duplicate?
Area
General CCCL
Is your feature request related to a problem? Please describe.
In the code base, for MSVC it is prefered to use
__pragma
over standard_Pragma
. This leads to code duplication in many cases.Describe the solution you'd like
Provide compiler independent
_CCCL_PRAGMA
macro implemented as (or something similar):It may be used as:
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: