changeset 354:9aaf1e788896

core/endian: fix compile error under clang
author Paper <paper@paper.us.eu.org>
date Sun, 14 Jul 2024 23:39:42 -0400
parents 2f094656e775
children 83e6ba09338f
files include/core/endian.h src/sys/x11/settings.cc
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/include/core/endian.h	Sun Jul 14 23:27:43 2024 -0400
+++ b/include/core/endian.h	Sun Jul 14 23:39:42 2024 -0400
@@ -93,7 +93,7 @@
 		} else if constexpr (std::is_same<T, uint64_t>::value) {
 			return byteswap_64(x);
 		} else {
-			static_assert(false, "byteswapping with unknown integer type");
+			static_assert(!sizeof(T), "invalid integer type given to byteswap");
 		}
 	}
 
--- a/src/sys/x11/settings.cc	Sun Jul 14 23:27:43 2024 -0400
+++ b/src/sys/x11/settings.cc	Sun Jul 14 23:39:42 2024 -0400
@@ -62,6 +62,7 @@
 		return true;
 	}
 
+	/* will fail on signed integers; xsettings has none of those though */
 	template<typename T>
 	bool ReadInt(T& ret) {
 		static_assert(std::is_integral<T>::value);