Commit 0bcf7755 authored by Alexandre Julliard's avatar Alexandre Julliard

Added support for #include in IDL files (based on a patch by Robert

Shearman).
parent 499cfcaf
......@@ -292,24 +292,39 @@ static void parse_idl_file( INCL_FILE *pFile, FILE *file )
while (fgets( buffer, sizeof(buffer)-1, file ))
{
char quote;
char *p = buffer;
line++;
while (*p && isspace(*p)) p++;
if (strncmp( p, "import", 6 )) continue;
if (!strncmp( p, "import", 6 ))
{
p += 6;
while (*p && isspace(*p)) p++;
if (*p != '\"') continue;
p++;
}
else
{
if (*p++ != '#') continue;
while (*p && isspace(*p)) p++;
if (strncmp( p, "include", 7 )) continue;
p += 7;
while (*p && isspace(*p)) p++;
if (*p != '\"' && *p != '<' ) continue;
}
quote = *p++;
if (quote == '<') quote = '>';
include = p;
while (*p && (*p != '\"')) p++;
while (*p && (*p != quote)) p++;
if (!*p)
{
fprintf( stderr, "%s:%d: Malformed import directive\n",
fprintf( stderr, "%s:%d: Malformed #include or import directive\n",
pFile->filename, line );
exit(1);
}
*p = 0;
add_include( pFile, include, line, 0 );
add_include( pFile, include, line, (quote == '>') );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment