Don't use gnu specific extensions to awk when builing symbols

Traditional posix awk doesn't know about \W and whilst we check that
awk exists in configure.ac we don't check which awk we are using.
This corrects symbol generation for posix only awk.
This commit is contained in:
Benjamin Close 2008-12-08 14:49:38 +10:30
parent 39db182b63
commit 8c1dd40a04

View File

@ -341,7 +341,7 @@ BEGIN {
# type specifier may not be set, as in
# extern _X_EXPORT unsigned name(...)
if ($n !~ /\W/)
if ($n !~ /[^[:alnum:]_]/)
n++;
# match
@ -349,12 +349,12 @@ BEGIN {
if ($n == "{")
n--;
# extern _X_EXPORT type (* name[])(...)
else if ($n ~ /^\W+$/)
else if ($n ~ /^[^[:alnum:]_]+$/)
n++;
# match
# extern _X_EXPORT const name *const ...
if ($n ~ /^(\W+)?const$/)
if ($n ~ /^([^[:alnum:]_]+)?const$/)
n++;
# actual name may be in the next line, as in
@ -370,10 +370,10 @@ BEGIN {
symbol = $n;
# remove starting non word chars
sub(/^\W+/, "",symbol);
sub(/^[^[:alnum:]_]+/, "",symbol);
# remove from first non word to end of line
sub(/\W.*/, "", symbol);
sub(/[^[:alnum:]_].*/, "", symbol);
#print;
printf(" &%s,\n", symbol);