From 27f0fc9450181c0b7907b37b788ef10c0c10dd33 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 21 May 2014 17:21:29 +0200 Subject: [PATCH] Issue 1454 --- tests/preproc/src/pasting.c | 1 + tests/preproc/wscript | 4 ++-- waflib/Tools/c_preproc.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/preproc/src/pasting.c b/tests/preproc/src/pasting.c index 8aaf9b7f..b9001e2b 100644 --- a/tests/preproc/src/pasting.c +++ b/tests/preproc/src/pasting.c @@ -6,3 +6,4 @@ #include STRINGIFY(PASTE(PREFIX_VAL, PASTE(a, SUFFIX_VAL)).h) +int main() {return 0;} diff --git a/tests/preproc/wscript b/tests/preproc/wscript index 63f1bc27..4f886588 100644 --- a/tests/preproc/wscript +++ b/tests/preproc/wscript @@ -65,9 +65,9 @@ def build(bld): color = "GREEN" else: color = "RED" - pprint(color, "%s" % (ret)) + pprint(color, "%s" % str(ret)) - test("fun6(math, h)", "math.h") + test("fun6(math, h)", ("<", "math.h")) def test(x, result): toks = c_preproc.tokenize(x) diff --git a/waflib/Tools/c_preproc.py b/waflib/Tools/c_preproc.py index 0a13b991..098af972 100644 --- a/waflib/Tools/c_preproc.py +++ b/waflib/Tools/c_preproc.py @@ -682,7 +682,8 @@ def extract_include(txt, defs): return '"', toks[0][1] else: if toks[0][1] == '<' and toks[-1][1] == '>': - return stringize(toks).lstrip('<').rstrip('>') + ret = '<', stringize(toks).lstrip('<').rstrip('>') + return ret raise PreprocError("could not parse include %s." % txt)