[PATCH 7/8] correct sparcv9 defines

[email protected]
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
From: Toomas Soome <[email protected]>

The SPARCV9 compile check needs to look for __sparcv9 on some systems,
and should also define "sparc".

Signed-off-by: Toomas Soome <[email protected]>
Signed-off-by: Luc Van Oostenryck <[email protected]>
Signed-off-by: John Levon <[email protected]>
---
 lib.c     | 1 +
 machine.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib.c b/lib.c
index 40e81ae2..3e9ad866 100644
--- a/lib.c
+++ b/lib.c
@@ -1380,6 +1380,7 @@ static void predefined_macros(void)
 	case MACH_SPARC32:
 		predefine("__sparc__", 1, "1");
 		predefine("__sparc", 1, "1");
+		predefine_nostd("sparc");
 		break;
 	case MACH_X86_64:
 		if (arch_m64 != ARCH_LP32) {
diff --git a/machine.h b/machine.h
index b46383ac..af5c96f1 100644
--- a/machine.h
+++ b/machine.h
@@ -62,7 +62,7 @@ enum machine {
 #define	MACH_NATIVE	MACH_RISCV64
 #elif defined(__riscv) && (__riscv_xlen == 32)
 #define	MACH_NATIVE	MACH_RISCV32
-#elif defined(__sparc_v9__)
+#elif defined(__sparc_v9__) || defined(__sparcv9)
 #define	MACH_NATIVE	MACH_SPARC64
 #elif defined(__sparc__) || defined(__sparc)
 #define	MACH_NATIVE	MACH_SPARC32
-- 
2.23.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.