#if defined(_MSC_VER)
/* Microsoft compiler */
# include <io.h>
-# define R_OK 4
#else
/* Anyone else */
# include <unistd.h>
#endif
-#include "../common/xmalloc.h"
+/* common */
+#include "xmalloc.h"
+/* cc65 */
#include "incpath.h"
}
/* Allocate memory for the new string */
- NewPath = xmalloc (OrigLen + NewLen + 2);
+ NewPath = (char*) xmalloc (OrigLen + NewLen + 2);
/* Copy the strings */
memcpy (NewPath, Orig, OrigLen);
strcpy (PathName + Count, File);
/* Check if this file exists */
- if (access (PathName, R_OK) == 0) {
+ if (access (PathName, 0) == 0) {
/* The file exists */
return xstrdup (PathName);
}