David Piepgrass | 26 Nov 17:23

Re: can %include include more than once?

I don't think that's possible.

You could probably use SWIG's nifty multiline macros as a substitute, by
putting put the contents of your include file inside of a big macro and
then invoking the macro repeatedly.

> -----Original Message-----
> From: Patrick M. [mailto:meierpatrick <at> ymail.com]
> Sent: Wednesday, November 26, 2008 7:56 AM
> To: swig-user <at> lists.sourceforge.net
> Subject: [Swig-user] can %include include more than once?
> 
> 
> The manual http://www.swig.org/Doc1.3/Preprocessor.html explains:
> "Unlike, #include, %include includes each file once (and will not
reload
> the
> file on subsequent %include declarations). Therefore, it is not
necessary
> to
> use include-guards in SWIG interfaces."
> 
> Although this behavior may be nice in most cases, I have a situation
where
> I
> must include a swig file several times in different places of a bigger
> project (the included swig file contains several #define's that are
> #undef'd
> later and #define'd again in a different place.)
> 
(Continue reading)


Gmane