Merge "Pass arch-specific global flags into generate scripts"
diff --git a/gen_constants.sh b/gen_constants.sh
index 7b39156..9f217ee 100755
--- a/gen_constants.sh
+++ b/gen_constants.sh
@@ -40,7 +40,7 @@
 #   { "AT_FDWCD", AT_FDCWD },
 # endif
 SED_MULTILINE='s@#define ([[:upper:]][[:upper:]0-9_]*).*@#ifdef \1\
-  { "\1", \1 },\
+  { "\1", (unsigned long) \1 },\
 #endif  // \1@'
 
 # Passes the previous list of #includes to the C preprocessor and prints out
@@ -54,7 +54,7 @@
 const struct constant_entry constant_table[] = {
 $(echo "$INCLUDES" | \
   ${CC} -dD - -E | \
-  grep '^#define [[:upper:]][[:upper:]0-9_]* ' | \
+  grep -E '^#define [[:upper:]][[:upper:]0-9_]*(\s)+[[:alnum:]]' | \
   grep -Ev '(SIGRTMAX|SIGRTMIN|SIG_|NULL)' | \
   sort -u | \
   sed -Ee "${SED_MULTILINE}")