Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/riscv/include riscv: Fix (U)INT64_C suffix to match...



details:   https://anonhg.NetBSD.org/src/rev/e3337dbfeea9
branches:  trunk
changeset: 377257:e3337dbfeea9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jul 04 01:02:50 2023 +0000

description:
riscv: Fix (U)INT64_C suffix to match gcc's built-in idea of types.

XXX pullup-10

diffstat:

 sys/arch/riscv/include/int_const.h |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r d13b79700b37 -r e3337dbfeea9 sys/arch/riscv/include/int_const.h
--- a/sys/arch/riscv/include/int_const.h        Tue Jul 04 01:02:26 2023 +0000
+++ b/sys/arch/riscv/include/int_const.h        Tue Jul 04 01:02:50 2023 +0000
@@ -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
 



Home | Main Index | Thread Index | Old Index