Skip to content

Commit 46c143e

Browse files
committed
fix(llvm): charconv on apple
This is a nasty workaround. Ideally, there should be a seqan::stl::from_chars.
1 parent 983dc3d commit 46c143e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

include/sharg/std/charconv

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,24 @@
1111
#ifndef SEQAN_STD_CHARCONV_SHIM // to avoid multiple definitions if other seqan modules also implement this
1212
#define SEQAN_STD_CHARCONV_SHIM
1313

14+
#include <version> // From C++20 onwards, all feature macros should be defined here.
15+
16+
// Workaround for llvm marking float charconv as unavailable
17+
#if defined(__APPLE__) && defined(_LIBCPP_VERSION)
18+
# ifdef _LIBCPP___CHARCONV_FROM_CHARS_FLOATING_POINT_H
19+
# warning This file needs to be included before any <charconv> include.
20+
# endif
21+
# if __has_include(<__configuration/availability.h>)
22+
# include <__configuration/availability.h>
23+
# undef _LIBCPP_AVAILABILITY_FROM_CHARS_FLOATING_POINT
24+
# define _LIBCPP_AVAILABILITY_FROM_CHARS_FLOATING_POINT /* nothing */
25+
# undef _LIBCPP_AVAILABILITY_HAS_FROM_CHARS_FLOATING_POINT
26+
# define _LIBCPP_AVAILABILITY_HAS_FROM_CHARS_FLOATING_POINT /* nothing */
27+
# endif
28+
#endif
29+
1430
#include <charconv>
1531
#include <utility> // __cpp_lib_to_chars may be defined here as currently documented.
16-
#include <version> // From C++20 onwards, all feature macros should be defined here.
1732

1833
/*!\defgroup std std
1934
* \ingroup misc

0 commit comments

Comments
 (0)