You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by cr...@goingware.com on 2000/02/26 15:15:54 UTC

long #include breaks Mac compile

I'm starting to work on building xerces under MacOS with Metrowerks Codewarrior.

The MacOS limits filenames to 32 characters.  The pathname delimiter on the 
Mac HFS filesystem is the colon ":" rather than the unix / or DOS backslash \ .

Xerces is full of #include lines that include the directory name, with the Unix / 
delimiter.

Generally compilers on other systems have the option to translate this (although 
not always - it's definitely a nonportable construct).

I'm not sure what the problem is exactly, but having a long #include line with a 
directory name causes compilation to fail on the Mac.  Simply removing the 
directory name will make it work.  The one that causes particular trouble is:

#include <util/ArrayIndexOutOfBoundsException.hpp>

removing the "util/" makes it work OK.

With Metrowerks on the Mac, you can have the compiler search a directory and 
all subdirectories, so once the directory name is removed everything is OK.  With 
Metrowerks on Windows, you have to explicitly set each directory that gets 
searched during a compile (subdirectories aren't included), so setting up the 
Windows project is pretty tedious.

I'm not sure what to do about this in such a way that I can fix this without 
breaking the build on other platforms.  I would prefer directory names were not 
used at all in #include lines, but that would take a lot of work for everyone to 
implement.  Probably shortening the length of the name of 
ArrayIndexOutOfBoundsException.hpp would be the best thing to do.

Mike Crawford
crawford@goingware.com
http://www.goingware.