How to avoid include the same source-file more than once?

How can I avoid include the same source-file more than once or the different files with the same content, when all files will be merged in only one binary file?

Let me clear this: In my programming language project, two classes with the same names will be merged, not generating a semantic error or whatever. Isn’t a bug, is a feature. :o)

E.g.

file1.arc

include “base.arc”

file2.arc

include “base.arc”

I don’t want use C/C+±like style guard or similar.
I think about an list of complete path of each file inside the compiler, or an checksum, generated over the bytes of file, like git index does.

Hi,

How can I avoid include the same source-file more than once or the different
files with the same content, when all files will be merged in only one binary file?

Let me clear this: In my programming language project, two classes with the same
names will be merged, not generating a semantic error or whatever. Isn't a bug,
is a feature. :o)

it sounds like you are looking for weak linkage (there are several kinds of weak
linkage, see http://llvm.org/docs/LangRef.html#linkage).

Ciao, Duncan.