@@ -2405,8 +2405,10 @@ sub process {
}
# check of hardware specific defines
# we have e.g. CONFIG_LINUX and CONFIG_WIN32 for common cases
-# where they might be necessary.
- if ($line =~ m@^.\s*\#\s*if.*\b__@) {
+# where they might be necessary. Ignore __NR and __TARGET_NR
+# definitions that are needed for linux-user builds
+ if (($line =~ m@^.\s*\#\s*if.*\b__@) &&
+ !($realfile =~ /^(linux|bsd)-user/ && $line =~ /__NR_/)) {
WARN("architecture specific defines should be avoided\n" . $herecurr);
}