From bd06155f348ecb421ad88fca65405f3a49408570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bourdeauducq?= Date: Thu, 5 Sep 2024 18:54:55 +0800 Subject: [PATCH] irrt: compatibility with pre-C23 compilers --- nac3core/irrt/irrt/int_types.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nac3core/irrt/irrt/int_types.hpp b/nac3core/irrt/irrt/int_types.hpp index 87900961..656a060e 100644 --- a/nac3core/irrt/irrt/int_types.hpp +++ b/nac3core/irrt/irrt/int_types.hpp @@ -1,13 +1,22 @@ #pragma once +#if __STDC_VERSION__ >= 202000 using int8_t = _BitInt(8); using uint8_t = unsigned _BitInt(8); using int32_t = _BitInt(32); using uint32_t = unsigned _BitInt(32); using int64_t = _BitInt(64); using uint64_t = unsigned _BitInt(64); +#else +using int8_t = _ExtInt(8); +using uint8_t = unsigned _ExtInt(8); +using int32_t = _ExtInt(32); +using uint32_t = unsigned _ExtInt(32); +using int64_t = _ExtInt(64); +using uint64_t = unsigned _ExtInt(64); +#endif // NDArray indices are always `uint32_t`. using NDIndex = uint32_t; // The type of an index or a value describing the length of a range/slice is always `int32_t`. -using SliceIndex = int32_t; \ No newline at end of file +using SliceIndex = int32_t;