diff --git a/src/ca65/incpath.c b/src/ca65/incpath.c index 9021f44a6..80db9ed63 100644 --- a/src/ca65/incpath.c +++ b/src/ca65/incpath.c @@ -38,7 +38,6 @@ #if defined(_MSC_VER) /* Microsoft compiler */ # include -# define R_OK 4 #else /* Anyone else */ # include @@ -137,10 +136,10 @@ static char* Find (const char* Path, const char* File) 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); - } + } /* Skip a list separator if we have one */ if (*P == ';') { diff --git a/src/cc65/error.c b/src/cc65/error.c index 6a2ab2aaf..dd2d17c57 100644 --- a/src/cc65/error.c +++ b/src/cc65/error.c @@ -101,7 +101,7 @@ static char* ErrMsg [ERR_COUNT-1] = { "`\"' or `<' expected", "Missing terminator or name too long", "Include file `%s' not found", - "Open failure on include file `%s'", + "Cannot open include file `%s': %s", "Invalid #error directive", "#error: %s", "Unexpected `#endif'", diff --git a/src/cc65/incpath.c b/src/cc65/incpath.c index 2776099b8..d0ba1f073 100644 --- a/src/cc65/incpath.c +++ b/src/cc65/incpath.c @@ -38,7 +38,6 @@ #if defined(_MSC_VER) /* Microsoft compiler */ # include -# define R_OK 4 #else /* Anyone else */ # include @@ -138,7 +137,7 @@ static char* Find (const char* Path, const char* File) 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); } diff --git a/src/cc65/input.c b/src/cc65/input.c index a6845e281..72e157bdb 100644 --- a/src/cc65/input.c +++ b/src/cc65/input.c @@ -156,7 +156,7 @@ void OpenIncludeFile (const char* Name, unsigned DirSpec) F = fopen (N, "r"); if (F == 0) { /* Error opening the file */ - PPError (ERR_INCLUDE_OPEN_FAILURE, N); + PPError (ERR_INCLUDE_OPEN_FAILURE, N, strerror (errno)); xfree (N); return; }