summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2023-07-04 01:02:50 +0000
committerriastradh <riastradh@NetBSD.org>2023-07-04 01:02:50 +0000
commit731af302671ca669d395667672a742de34ef7743 (patch)
treea5fa79dab715f091f676dc5f75f4c8c579292bf2
parent01b7970d3397490fc65fb45c038b7ecec129a44e (diff)
riscv: Fix (U)INT64_C suffix to match gcc's built-in idea of types.
XXX pullup-10
-rw-r--r--sys/arch/riscv/include/int_const.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/arch/riscv/include/int_const.h b/sys/arch/riscv/include/int_const.h
index f8f13df3fac..db3b188b16d 100644
--- a/sys/arch/riscv/include/int_const.h
+++ b/sys/arch/riscv/include/int_const.h
@@ -1,19 +1,32 @@
-/* $NetBSD: int_const.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */
+/* $NetBSD: int_const.h,v 1.2 2023/07/04 01:02:50 riastradh Exp $ */
#ifndef __INTMAX_C_SUFFIX__
#define __INT8_C_SUFFIX__
#define __INT16_C_SUFFIX__
#define __INT32_C_SUFFIX__
+#ifdef _LP64
+#define __INT64_C_SUFFIX__ L
+#else
#define __INT64_C_SUFFIX__ LL
+#endif
#define __UINT8_C_SUFFIX__
#define __UINT16_C_SUFFIX__
#define __UINT32_C_SUFFIX__
+#ifdef _LP64
+#define __UINT64_C_SUFFIX__ UL
+#else
#define __UINT64_C_SUFFIX__ ULL
+#endif
+#ifdef _LP64
+#define __INTMAX_C_SUFFIX__ L
+#define __UINTMAX_C_SUFFIX__ UL
+#else
#define __INTMAX_C_SUFFIX__ LL
#define __UINTMAX_C_SUFFIX__ ULL
+#endif
#endif