summaryrefslogtreecommitdiff
path: root/macros.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-19 21:42:42 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-19 21:42:42 -0700
commitb2a5fda157a0a7203652d0fcb02975629ce02cef (patch)
tree85c6a5d6d651bb45d5a63d464c02051ede4afae9 /macros.pl
parentf4ae5ad11bb11d85b8e9deb49cce1707db4749f2 (diff)
downloadnasm-b2a5fda157a0a7203652d0fcb02975629ce02cef.tar.gz
Somewhat more clever way to generate the %use guard macros
Automatically generate a %define as the first string in the include block, and just pick the string out of it from that %define statement to verify existence. That way we eliminate any use of toupper() -- all case-insensitivity in NASM uses tolower()/nasm_tolower().
Diffstat (limited to 'macros.pl')
-rwxr-xr-xmacros.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/macros.pl b/macros.pl
index cfddb6ad..5429a5ea 100755
--- a/macros.pl
+++ b/macros.pl
@@ -56,6 +56,8 @@ foreach $fname ( @ARGV ) {
push(@pkg_list, $pkg);
$pkg_number{$pkg} = $npkg++;
$pkg_index{$pkg} = $index;
+ printf OUT " /* %4d */ \"\\x%02x\"\"%s\",\n",
+ $index++, $pptok_hash{'%define'}+128, "__USE_\U$pkg\E__";
} elsif (m/^\s*((\s*([^\"\';\s]+|\"[^\"]*\"|\'[^\']*\'))*)\s*(;.*)?$/) {
my $s1, $s2, $pd, $ws;
$s1 = $1;