--- ray/src/gen/xform.c 2003/03/11 19:29:05 2.24 +++ ray/src/gen/xform.c 2003/07/03 22:41:44 2.29 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: xform.c,v 2.24 2003/03/11 19:29:05 greg Exp $"; +static const char RCSid[] = "$Id: xform.c,v 2.29 2003/07/03 22:41:44 schorsch Exp $"; #endif /* * xform.c - program to transform object files. @@ -9,14 +9,15 @@ static const char RCSid[] = "$Id: xform.c,v 2.24 2003/ * 11/6/86 Finally added error checking! */ -#include "standard.h" - -#include "paths.h" - #include +#ifndef _WIN32 + #include +#endif +#include "standard.h" +#include "platform.h" +#include "paths.h" #include "object.h" - #include "otypes.h" int xac; /* global xform argument count */ @@ -42,7 +43,7 @@ int nrept = 1; /* number of array repetitions */ int stdinused = 0; /* stdin has been used by -f option? */ -char mainfn[MAXPATH]; /* main file name */ +char mainfn[PATH_MAX]; /* main file name */ FILE *mainfp = NULL; /* main file pointer */ #define progname (xav[0]) @@ -889,8 +890,8 @@ char *fname; openmain(iname) /* open input, changing directory for file */ char *iname; { - static char origdir[MAXPATH]; - static char curfn[MAXPATH]; + static char origdir[PATH_MAX]; + static char curfn[PATH_MAX]; static int diffdir; register char *fpath; @@ -916,7 +917,7 @@ char *iname; return; } if (mainfp == NULL) { /* first call, initialize */ - getwd(origdir); + getcwd(origdir, sizeof(origdir)); } else if (!strcmp(iname, curfn)) { /* just need to rewind? */ rewind(mainfp); return; @@ -930,7 +931,7 @@ char *iname; } strcpy(curfn, iname); /* remember input name */ /* get full path for file */ - if ((fpath = getpath(iname, getlibpath(), R_OK)) == NULL) { + if ((fpath = getpath(iname, getrlibpath(), R_OK)) == NULL) { fprintf(stderr, "%s: cannot find file \"%s\"\n", progname, iname); exit(1);