diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp --- a/libcxx/src/filesystem/operations.cpp +++ b/libcxx/src/filesystem/operations.cpp @@ -534,7 +534,7 @@ ErrorHandler err("canonical", ec, &orig_p, &cwd); path p = __do_absolute(orig_p, &cwd, ec); -#if _POSIX_VERSION >= 200112 +#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112 std::unique_ptr hold(::realpath(p.c_str(), nullptr), &::free); if (hold.get() == nullptr) diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -1149,7 +1149,7 @@ { return _LIBCPP_GET_C_LOCALE->__ctype_toupper; } -#elif __NetBSD__ +#elif defined(__NetBSD__) const short* ctype::__classic_lower_table() _NOEXCEPT {