Re: [AD] Compiling with VC

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> That only protects against multiple includes in a single source file. If 
> you include allegro.h in a second file, there's no way to gaurd things 
> out, so you'll get two #pragma's.

It's an error to have two objects with the same name in a program, so 
having two libraries that define the same symbols is an error too.
A special case could be when the same library is specified more than once 
for linking: the compiler could catch this case and silently ignore extra 
occurences of a library that was already included for linking.

Personally, I wouldn't bother to make my compiler do this and just tell my 
user to not be so silly as to link against the same library more than 
once. This is MSVC though, and Microsfoft might be more considerate than I 
would be in such a case. Ultimately, the only way to find out is to test 
it. I don't have MSVC (although I understand the commandline utilities are 
free for download, so I might as well get those to test things like this 
with), so someone else should test this.

If it turns out that this works, then I'm not opposed to including such a 
patch in Allegro - although I do think #pragma's are evil ;)

Evert





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/