yhirose / cpp-peglib

A single file C++ header-only PEG (Parsing Expression Grammars) library
MIT License
916 stars 113 forks source link

std::to_chars is not available on macOS 10.14 and earlier despite charconv header existing #181

Closed trilader closed 3 years ago

trilader commented 3 years ago

This is related to #167

When building on macOS 10.15 and newer but deploying to an earlier macOS version (10.14 and below) <charconv> exists but std::from_chars is not actually defined.

As per this libc++ change the necessary symbols to actually use std::from_chars were only introduced in macOS 10.15.

My current (ugly) workaround is to add && (!defined(__APPLE__) || MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15) to the __has_include(<charconv>) check.

yhirose commented 3 years ago

@trilader, thanks for the feedback. I think it's not a matter of version of macOS, but XCode version or clang version. Could you investigate it more please, and send a pull request? Thanks!

trilader commented 3 years ago

Hm: I unfortunately can't reproduce this anymore. It was happening consistently but doesn't anymore after trying a bunch of things and then reverting my project repository to the state I had the error with... I have no idea what I did to get it working. Clean/Rebuild didn't help before but maybe there was something cached elsewhere outside my project and build directories.