diff options
author | jkim <jkim@FreeBSD.org> | 2015-05-18 23:46:11 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2015-05-18 23:46:11 +0000 |
commit | fcf0fbf9ed4820d5be560952f5a24594b0a63a67 (patch) | |
tree | e88c112446963b036bdd2b1d402ebf1f8bf9bc10 /sys/contrib/dev/acpica/compiler/aslfiles.c | |
parent | af288ae5ce3e6f865488a2e09e8b3480e5247a74 (diff) | |
parent | 10842bd3d05a791e4f526aa9c904791bb26615e4 (diff) | |
download | FreeBSD-src-fcf0fbf9ed4820d5be560952f5a24594b0a63a67.zip FreeBSD-src-fcf0fbf9ed4820d5be560952f5a24594b0a63a67.tar.gz |
Merge ACPICA 20150515.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/aslfiles.c')
-rw-r--r-- | sys/contrib/dev/acpica/compiler/aslfiles.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslfiles.c b/sys/contrib/dev/acpica/compiler/aslfiles.c index 63a8dbb..d8c9ed5 100644 --- a/sys/contrib/dev/acpica/compiler/aslfiles.c +++ b/sys/contrib/dev/acpica/compiler/aslfiles.c @@ -49,9 +49,10 @@ /* Local prototypes */ -FILE * +static FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, + ACPI_PARSE_OBJECT *Op, char *Filename); @@ -294,9 +295,10 @@ ConvertBackslashes: * ******************************************************************************/ -FILE * +static FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, + ACPI_PARSE_OBJECT *Op, char *Filename) { FILE *IncludeFile; @@ -320,6 +322,26 @@ FlOpenIncludeWithPrefix ( return (NULL); } +#ifdef _MUST_HANDLE_COMMENTS + /* + * Check entire include file for any # preprocessor directives. + * This is because there may be some confusion between the #include + * preprocessor directive and the ASL Include statement. + */ + while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, IncludeFile)) + { + if (Gbl_CurrentLineBuffer[0] == '#') + { + AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE, + Op, "use #include instead"); + } + } +#endif + + /* Must seek back to the start of the file */ + + fseek (IncludeFile, 0, SEEK_SET); + /* Push the include file on the open input file stack */ AslPushInputFileStack (IncludeFile, Pathname); @@ -376,7 +398,7 @@ FlOpenIncludeFile ( (Op->Asl.Value.String[0] == '\\') || (Op->Asl.Value.String[1] == ':')) { - IncludeFile = FlOpenIncludeWithPrefix ("", Op->Asl.Value.String); + IncludeFile = FlOpenIncludeWithPrefix ("", Op, Op->Asl.Value.String); if (!IncludeFile) { goto ErrorExit; @@ -392,7 +414,7 @@ FlOpenIncludeFile ( * * Construct the file pathname from the global directory name. */ - IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op->Asl.Value.String); + IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op, Op->Asl.Value.String); if (IncludeFile) { return; @@ -405,7 +427,7 @@ FlOpenIncludeFile ( NextDir = Gbl_IncludeDirList; while (NextDir) { - IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op->Asl.Value.String); + IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op, Op->Asl.Value.String); if (IncludeFile) { return; |