Reputation: 531
I'm not allowed to change the code. So I can not use #pragma
. So my Question is what is the Preprocessor define that I need to pass to the compiler to disable the warning of the function GetVersionExW
?
I tried:
_CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_DEPRECATE
_WINSOCK_DEPRECATED_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
Upvotes: 1
Views: 2171
Reputation: 51364
The API call GetVersionExW
is declared using __declspec(deprecated). There is no way to disable a warning for particular API call.
Your only option is to disable Warning C4996 altogether, either through a preprocessor pragma warning before including the respective header file, or globally in the project settings (compiler option /wd).
Upvotes: 4