Abort object compile from code?
I''m developing for Linux and win32 both from MSVC. All my win32 specific code will call win32.h (which in turn includes stuff like windows.h etc). So, all my linux specific files call Linux.h.
I was wondering if I could exploit this by getting the compiler to stop compiling an object when it finds some kind of token\pragma\something in this file. Currently I just have this:
#ifndef _WIN32
# error This file should only be used in a Microsoft Windows build.
#endif
Likewise with Linux....
I''d however like the compiler to skip over the linux files when it hits this include file.
I know I could just brace all my OS files with #ifndef _WIN32 preprocessor directives but that seems kludgy to have to modify every single file.
I checked out pragma in MSDN but didn''t find any easy way of doing this.
Is it possible?
Many thanks
Chris
Chris Brodie
http:\\fourth.flipcode.com
Chris Brodie
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement