Hello,
I noticed that if I add a custom include dir to the compiler, and include once a file that lives both in the NSIS include and the custom include, the compiler includes it twice 😱 !
Is it a bug or a feature?
Strange behaviour of !include
5 posts
I'd say it's neither! How should it know which of the two to include? It's your fault for putting it in both directories!
-Stu
-Stu
Originally posted by Afrow UKWell... I don't think it is right to consider a case like "it's the user fault, never mind". This situation happened to me, and I just found that the compiler behaviour was strange
I'd say it's neither! How should it know which of the two to include? It's your fault for putting it in both directories!
IMHO the compiler should either emit a warning, or include only the standard include.
Cheers
I see your point. But, consider that NSIS was purposfully designed to be as minimal as possible to cut down on on the overhead of the installation.
To get around this type of thing, you'll notice that most of the !includes included with NSIS put their includes in an !ifdef/!ifndef block. For example, if you have an include file a function 'foo', then the entire include file might be something like:
If this is still a change you feel strongly about, then you should add it as a suggestion on the
NSIS SourceForge page.
To get around this type of thing, you'll notice that most of the !includes included with NSIS put their includes in an !ifdef/!ifndef block. For example, if you have an include file a function 'foo', then the entire include file might be something like:
This way, if the file gets included more than once, it's no big deal since the compiler will ignore 2nd and subsequent calls to the same file.
!ifndef foo
!define foo
...
[insert code here]
...
!endif
If this is still a change you feel strongly about, then you should add it as a suggestion on the
NSIS SourceForge page.