Advertisement

Abort object compile from code?

Started by June 13, 2001 07:11 PM
0 comments, last by gimp 23 years, 8 months ago
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
Why not only include the relevant files in the makefile/project? Put the platform specific files in separate directories if it makes it easier.

This topic is closed to new replies.

Advertisement