Skip to content

Commit bd1c285

Browse files
authored
Fix broken build on OS X (#35)
Signed-off-by: Gregory Brail <[email protected]>
1 parent cc6ef26 commit bd1c285

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bazel-*

WORKSPACE

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ git_repository(
3535
name = "com_google_protobuf",
3636
commit = "655310ca192a6e3a050e0ca0b7084a2968072260",
3737
remote = "https://github.com/protocolbuffers/protobuf",
38+
shallow_since = "1565024848 -0700",
3839
)
3940

4041
http_archive(

include/proxy-wasm/compat.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@
2626
#endif
2727

2828
namespace proxy_wasm {
29-
#ifndef __cpp_lib_optional
30-
template <typename T> using optional = absl::optional<T>;
31-
// Only available in C++17
32-
// inline constexpr absl::nullopt_t nullopt = absl::nullopt;
33-
#define PROXY_WASM_NULLOPT absl::nullopt
34-
#else
29+
#if __cplusplus >= 201703L
30+
3531
template <typename T> using optional = std::optional<T>;
3632
// Only available in C++17
3733
// inline constexpr std::nullopt_t nullopt = std::nullopt;
3834
#define PROXY_WASM_NULLOPT std::nullopt
39-
#endif
35+
using string_view = std::string_view;
4036

41-
#ifndef __cpp_lib_string_view
42-
using string_view = absl::string_view;
4337
#else
44-
using string_view = std::string_view;
38+
39+
template <typename T> using optional = absl::optional<T>;
40+
// Only available in C++17
41+
// inline constexpr absl::nullopt_t nullopt = absl::nullopt;
42+
#define PROXY_WASM_NULLOPT absl::nullopt
43+
using string_view = absl::string_view;
44+
4545
#endif
4646
} // namespace proxy_wasm

0 commit comments

Comments
 (0)