I *did* need to truncate the "#include filename" filenames
to get anything to compile. [ With BORLAND C ]
Guido, here is the awk script I used, in case you want to fold it
into the distribution. Replaces all
#include longfilename.h with:
#ifdef __MSDOS__
#include longfile.h
#else
#include longfilename.h
#endif
It doesn't try to do anything with "#include <filename>", but all of
those occurances seem to be short enough names.
It does not look like truncation produces any duplicate names.
/^#[ \t]*include[ \t]*"[A-Za-z0-9]*/ { \
file = $2;
n = split( file, a, "." );
name = a[1];
ext = a[2];
if ( length( name ) < 10 ) {
print ;
}
else {
print "#ifdef __MSDOS__ ", "\t/*** Truncate file name ***/" ;
print $1, substr(name,0,9) "." ext;
print "#else";
print;
print "#endif","\t/*** MSDOS *** Truncate file name ***/" ;
}
}
! /^#[ \t]*include[ \t]*"[A-Za-z0-9]*/ { print }
Was this step *not* needed with MSC ( or whatever was used ) ?
Any other tips/problems noted ?
[ Otherwise, I've been busy learning ( but not liking C++ ). ]
- Steve Majewski