View Single Post
Join Date: Aug 2008
Posts: 206
Reputation: grumpier has a spectacular aura about grumpier has a spectacular aura about 
Solved Threads: 31
grumpier grumpier is offline Offline
Posting Whiz in Training

Re: Preprocessor #warning Command Question

 
0
  #6
Oct 8th, 2008
Salem is right; there is no way to #define a macro that expands to a preprocessor directive.

There is also the incidental concern that #warning is not a standard preprocessor directive.

Any C++ compiler will generate an error on an attempt to call a function that has not previously been declared.

I can't see the point of what you're trying to do. If <window.h> is not included
  1. #ifndef _WINDOWS_H
  2. #error <windows.h> needs to be included to compile this source file
  3. #endif
will generate an error message that gives specific information on requirements.

Of course, if you need to use the above (eg if you have a header that relies on <windows.h>) it would be easier to #include <windows.h> anyway
Reply With Quote