optlist.h
Currently, options.c is the only file that #includes "optlist.h". In theory, if a source file did want to include optlist.h (perhaps for the struct allopt_t declaration so they could deal with a pointer to such a struct), they wouldn't be able to include it because of a static function prototype that it contains. Add some protection to only include that static function prototype when optlist.h is included from options.c.
This commit is contained in:
@@ -50,6 +50,8 @@ NEARDATA struct instance_flags iflags; /* provide linkage */
|
||||
*
|
||||
*/
|
||||
|
||||
#define OPTIONS_C
|
||||
|
||||
#define NHOPT_PROTO
|
||||
#include "optlist.h"
|
||||
#undef NHOPT_PROTO
|
||||
@@ -72,6 +74,7 @@ static struct allopt_t allopt_init[] = {
|
||||
};
|
||||
#undef NHOPT_PARSE
|
||||
|
||||
#undef OPTIONS_C
|
||||
|
||||
#define PILE_LIMIT_DFLT 5
|
||||
#define rolestring(val, array, field) \
|
||||
|
||||
Reference in New Issue
Block a user