Added support for accepting the Unix directory separator '/' on Windows and the Mac

in addition to the native one ( '\' on Windows). This can be used in %import, %include
and commandline options taking a path, for example -I.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5538 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2003-12-11 21:21:42 +00:00
commit a998837604

View file

@ -492,6 +492,10 @@ get_filename(String *str) {
while (((c = Getc(str)) != EOF) && (!isspace(c))) Putc(c,fn);
if (isspace(c)) Ungetc(c,str);
}
#if defined(_WIN32) || defined(MACSWIG)
/* accept Unix file separator on non-Unix systems */
Replaceall(fn, "/", SWIG_FILE_DELIMETER);
#endif
Seek(fn,0,SEEK_SET);
return fn;
}