Snort mailing list archives

Re: include question


From: Matt Kettler <mkettler () evi-inc com>
Date: Wed, 30 Jan 2002 15:52:05 -0500

This is a bit "how to program correctly 101"ish, but here goes..

Each header also has multi-include protection defines. Any good programer adds these to every header file, every time. Heck, there are lots of development tools, scripts, etc which make these for you automatically.

for example plugbase.h has:

#ifndef __PLUGBASE_H__
#define __PLUGBASE_H__

(insert actual header file contents here)

#endif /* __PLUGBASE_H__ */


Which essentially causes the second include of plugbase.h to be preprocessed away into nothing since the second time around __PLUGBASE_H__ is defined.

I'd check to make sure the header for the preprocessor you are playing with is also properly written with multi-include protections.


At 01:37 PM 1/30/2002 -0600, Steve Halligan wrote:
Each preprocessor includes its own header file.
Each preprocessor also includes snort.h.
snort.h includes plugbase.h.
plugbase.h includes all the preprocessor headers.
Isn't this redundant?
I ask because a struct in the header for the preprocessor I was playing with
caused a error while compiling, something about declaring it twice.  If the
above is true, I can see why.


_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users


Current thread: