[vox-tech] Asking C compiler to test for #include file

Bill Kendrick vox-tech@lists.lugod.org
Sun, 20 Jul 2003 11:42:14 -0700


On Sun, Jul 20, 2003 at 10:23:08AM -0700, Ken Bloom wrote:
> 
> I don't think the header guards (the #ifndef/#define/#endif that is 
> supposed to surround every header file) are necessarily portable, but 
> you could try somehting like this:
> 
> #include "somelib.h"
> #ifndef __SOMELIB_Hs_HEADER_GUARD__
>   #error "Ya big dummy!..."
> #endif

I can try this... seeing as it complains for ALL missing includes, I have a feeling the
preprocessor doesn't bail after the first one, so the "#ifndef" might have a chance to get seen ;)

I don't mind the GCC error coming out first, as long as I can 'SPLAIN it afterwards. ;^)

Thanks for the tip!

-bill!

-- 
bill@newbreedsoftware.com                           Got kids?  Get Tux Paint! 
http://newbreedsoftware.com/bill/       http://newbreedsoftware.com/tuxpaint/