[libcxx-commits] [libcxx] [libc++] Complete `<charconv>` for 64-bit `long double` platforms (PR #117125)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 28 11:36:53 PST 2024


================
@@ -1231,6 +1231,12 @@ typedef __char32_t char32_t;
 #    define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 0
 #  endif
 
+#  if defined(_MSC_VER) || __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
----------------
ldionne wrote:

I do agree it would be safer if the compiler provided some `#define` that told us basically "double and long double have the same size and representation". I don't know that this is provided by any compiler, though. One thing we could do is explicitly list the platforms on which we know that this is the case for certain. That way we'd be more conservative (i.e. the assumption may hold for some platforms that we wouldn't list, but at least we'd never make the assumptions for platforms where that's not true).

https://github.com/llvm/llvm-project/pull/117125


More information about the libcxx-commits mailing list