header-checker: Downgrade to C++ 14
This commit switches the option to `-std=c++14` to avoid potential ODR
violations and fix the Mac build.
This commit downgrades from `-std=c++17` to `-std=c++14` because
"llvm/Support/RWMutex.h" from clang-r370808 will use `std::shared_mutex`
when `-std=c++17` is specified but LLVM/Clang prebuilts are built with a
different implementation.
Furthermore, Mac OS X 10.8 (or 10.9) does not support
`std::shared_mutex`. Thus, there are availability errors when we are
building header-checker for Mac OS X:
clang-r370808/include/llvm/Support/RWMutex.h:98:8:
error: 'shared_mutex' is unavailable: introduced in macOS 10.12
Bug: 139945549
Test: OUT_DIR=out && \
development/vndk/tools/header-checker/android/build-prebuilts.sh
Change-Id: Ic23fbdb67f7cd0700a3001c644485f7d8d0ee3e2
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "utils/string_utils.h"
|
||||
|
||||
#include <llvm/ADT/Optional.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cstdlib>
|
||||
@@ -72,7 +74,7 @@ std::vector<std::string_view> Split(std::string_view s,
|
||||
}
|
||||
|
||||
|
||||
std::optional<int> ParseInt(const std::string &s) {
|
||||
llvm::Optional<int> ParseInt(const std::string &s) {
|
||||
const char *start = s.c_str();
|
||||
if (*start == '\0') {
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user