[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: multiple inclusion guard for config.h
From: |
David Byron |
Subject: |
RE: multiple inclusion guard for config.h |
Date: |
Sun, 21 Jan 2007 09:39:38 -0800 |
On Saturday, January 20, 2007 @ 5:50p, Ed Hartnett wrote:
> David Byron wrote:
>
> > Any suggestions how? I've seen people write scripts to
> > modify/rename config.h but that seems overkill in this
> > case.
>
> How about something like:
>
> #ifndef MY_CONFIG_INCLUDED
> #include <../my/config.h>
> #define MY_CONFIG_INCLUDED
> #endif
I was hoping for something where each include could just do the normal
thing:
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
I ended up with:
AH_TOP([#ifndef INCLUDED_CONFIG_H
#define INCLUDED_CONFIG_H])
AC_CONFIG_HEADERS([config.h],[echo "#endif /* INCLUDED_CONFIG_H */" >>
config.h])
Yes, if this preprocessor symbol shows up in another include file, I'm
screwed. In my case that doesn't happen but I suppose some convention of
using the package name would be safer.
Thanks for your help.
-DB