summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-26 09:32:57 -0700
committerCarl Worth <cworth@cworth.org>2010-05-26 09:33:23 -0700
commitf6914fd37b2b66d7be1ba0c31450d89d1785ccce (patch)
treefa6636662a63e2675a5173e772ac253016fa8fe8
parent8fed1cddae8b024972d0c08f120bfd0292cb9cca (diff)
Implement #if and friends.
With this change, tests 41 through 49 all pass. (The defined operator appears to be somehow broken so that test 50 doesn't pass yet.)
-rw-r--r--glcpp.h2
-rw-r--r--tests/049-if-expression-precedence.c1
-rw-r--r--tests/050-if-defined.c2
-rwxr-xr-xtests/glcpp-test2
4 files changed, 2 insertions, 5 deletions
diff --git a/glcpp.h b/glcpp.h
index 21db918..36ab0e7 100644
--- a/glcpp.h
+++ b/glcpp.h
@@ -49,7 +49,7 @@ typedef struct token_list token_list_t;
typedef union YYSTYPE
{
- int ival;
+ intmax_t ival;
char *str;
string_list_t *string_list;
token_t *token;
diff --git a/tests/049-if-expression-precedence.c b/tests/049-if-expression-precedence.c
index cea9352..833ea03 100644
--- a/tests/049-if-expression-precedence.c
+++ b/tests/049-if-expression-precedence.c
@@ -3,4 +3,3 @@ failure with operator precedence
#else
success
#endif
-
diff --git a/tests/050-if-defined.c b/tests/050-if-defined.c
index 9838cc7..34f0f95 100644
--- a/tests/050-if-defined.c
+++ b/tests/050-if-defined.c
@@ -15,5 +15,3 @@ failure_3
#else
success_3
#endif
-
-
diff --git a/tests/glcpp-test b/tests/glcpp-test
index 6304155..bf88d44 100755
--- a/tests/glcpp-test
+++ b/tests/glcpp-test
@@ -6,5 +6,5 @@ for test in *.c; do
../glcpp < $test > $test.out
gcc -E $test -o $test.gcc
grep -v '^#' < $test.gcc > $test.expected
- diff -u $test.expected $test.out
+ diff -B -u $test.expected $test.out
done