|
|
In every of my include files, I have a parameter named
_tnw_includefile_ending_
So for my io_macs.inc this would be
_tnw_io_macs_inc_
And its just declared as 1 (similiar to true).
When a different file is based on such an include
file, it checks if that parameter is already declared,
and only includes if its not (using #ifndef).
This doesn't hinder the user from including it once
again AFTER some other include has included it,
but it takes care that all required files will be loaded
at least once, and won't issue warnings.
--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde
> Would it be possible to add a #require command, as in php.
> This would add the file only *once* for each scene, no matter
> how often the #require"this_file" is found.
>
> Or is there already a good way to avoid multiple including of a file ?
> Thanks.
> --
> sharl.
>
>
>
Post a reply to this message
|
|