Schafwolle
Schafwolle

Reputation: 531

What is the Preprocessor define to disable the Warning "GetVersionExW': was declared deprecated"

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:

Upvotes: 1

Views: 2171

Answers (2)

IInspectable
IInspectable

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

msc
msc

Reputation: 34588

Try this:

#pragma warning(disable: <warning number>)

Upvotes: 1

Related Questions