From 3d099d11eb70c3facc0e24c4ce578dc39d7355d6 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sun, 30 Dec 2007 10:21:51 +0000 Subject: [PATCH] - ReactOS Specific! WIDL in ReactOS is called with a header name including the relative path to it. Thus, the generated #ifndef __WIDL directive also includes the tokenized path to the file, which doesn't conform to its usage in Wine (where it's just __WIDL_HEADERNAME_H). In order to solve this, a small piece of code was added, which omits the relative path from the string sent to the tokenizer. The only drawback is that the headername passed to the WIDL must never mix different style path separators ('/' and '\\'). svn path=/trunk/; revision=31498 --- reactos/tools/widl/widl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/tools/widl/widl.c b/reactos/tools/widl/widl.c index c6c4a1cd84c..399d3cbaee2 100644 --- a/reactos/tools/widl/widl.c +++ b/reactos/tools/widl/widl.c @@ -327,7 +327,12 @@ int main(int argc,char *argv[]) } if(do_header) { - header_token = make_token(header_name); + if (strrchr(header_name, '\\')) + header_token = make_token(strrchr(header_name, '\\') + 1); + else if (strrchr(header_name, '/')) + header_token = make_token(strrchr(header_name, '/') + 1); + else + header_token = make_token(header_name); if(!(header = fopen(header_name, "w"))) { fprintf(stderr, "Could not open %s for output\n", header_name);