gen_{constants,syscalls}: fix sed/grep locale issues

The A-Z/a-z classes are not guaranteed to match the 26 english characters
in all locales -- they might match more or fewer characters.  Use classes
instead so we know they'll always match.

Change-Id: Id8046a4f663c7bdb8fa46911d953716d6ba4bdb6
diff --git a/gen_constants.sh b/gen_constants.sh
index 5175d15..8b311e3 100755
--- a/gen_constants.sh
+++ b/gen_constants.sh
@@ -39,7 +39,7 @@
 # #ifdef AT_FDCWD
 #   { "AT_FDWCD", AT_FDCWD },
 # endif
-SED_MULTILINE='s/#define \([A-Z][A-Z0-9_]*\).*/#ifdef \1\
+SED_MULTILINE='s/#define \([[:upper:]][[:upper:]0-9_]*\).*/#ifdef \1\
   { "\1", \1 },\
 #endif  \/\/ \1/'
 
@@ -54,7 +54,7 @@
 const struct constant_entry constant_table[] = {
 $(echo "$INCLUDES" | \
   ${CC} -dD - -E | \
-  grep '^#define [A-Z][A-Z0-9_]* ' | \
+  grep '^#define [[:upper:]][[:upper:]0-9_]* ' | \
   grep -v '\(SIGRTMAX\|SIGRTMIN\|SIG_\|NULL\)' | \
   sort | \
   uniq | \
diff --git a/gen_syscalls.sh b/gen_syscalls.sh
index 1e4039b..579f8bc 100755
--- a/gen_syscalls.sh
+++ b/gen_syscalls.sh
@@ -31,7 +31,7 @@
 # #ifdef __NR_read
 #  { "read", __NR_read },
 # #endif
-SED_MULTILINE='s/#define __(ARM_)?(NR_)([a-z0-9_]*) (.*)$/#ifdef __\1\2\3\
+SED_MULTILINE='s/#define __(ARM_)?(NR_)([[:lower:]0-9_]*) (.*)$/#ifdef __\1\2\3\
 { "\1\3", __\1\2\3 },\
 #endif/g p;'