mirror of
https://github.com/cc65/cc65.git
synced 2024-06-26 05:29:30 +00:00
Make pragma once work even in .c files
This commit is contained in:
parent
98208e7e95
commit
57e6c2a4f9
|
@ -46,8 +46,6 @@
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "strpool.h"
|
#include "strpool.h"
|
||||||
#include "abend.h"
|
#include "abend.h"
|
||||||
#include "searchpath.h"
|
|
||||||
#include "incpath.h"
|
|
||||||
#include "pathutil.h"
|
#include "pathutil.h"
|
||||||
|
|
||||||
/* cc65 */
|
/* cc65 */
|
||||||
|
@ -2973,19 +2971,16 @@ static void DoPragmaOnce (void)
|
||||||
/* Marks the current file as seen by #pragma once. */
|
/* Marks the current file as seen by #pragma once. */
|
||||||
{
|
{
|
||||||
const char * const Filename = GetCurrentFilename ();
|
const char * const Filename = GetCurrentFilename ();
|
||||||
char * const IncludePath = SearchFile(UsrIncSearchPath, Filename);
|
|
||||||
|
|
||||||
if (IncludePath == NULL) {
|
char * const FullPath = FindRealPath (Filename);
|
||||||
AbEnd ("Cannot find the full path for the file %s", Filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * const FullPath = FindRealPath(IncludePath);
|
|
||||||
|
|
||||||
if (FullPath == NULL) {
|
if (FullPath == NULL) {
|
||||||
AbEnd ("Failed to find the full path for the file %s", Filename);
|
AbEnd ("Failed to find the real path for the file %s", Filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
SP_AddStr(PragmaOnceSeenFiles, FullPath);
|
SP_AddStr (PragmaOnceSeenFiles, FullPath);
|
||||||
|
|
||||||
|
free (FullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DoPragma (void)
|
static void DoPragma (void)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user