Skip to content

Commit

Permalink
PR #1819: fix compilation with AppleClang (#1820)
Browse files Browse the repository at this point in the history
Imported from GitHub PR #1819

Fix the following error:

absl/random/internal/randen_detect.cc:123:12: error: no member named 'nullopt' in namespace 'std'; did you mean 'absl::nullopt'?
  123 |     return std::nullopt;
      |            ^~~~~~~~~~~~
      |            absl::nullopt
absl/types/optional.h:86:43: note: 'absl::nullopt' declared here
   86 | ABSL_INTERNAL_INLINE_CONSTEXPR(nullopt_t, nullopt,
      |                                           ^
Merge b9a2d39 into 7253ff8

Merging this change closes #1819

COPYBARA_INTEGRATE_REVIEW=#1819 from clementperon:master b9a2d39
PiperOrigin-RevId: 722599523
Change-Id: Ie66cbf9daf3b115668194da8b74acd6a43e12a03

Co-authored-by: Clément Péron <[email protected]>
  • Loading branch information
derekmauro and clementperon authored Feb 3, 2025
1 parent 98ebd7e commit 9ac7062
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion absl/random/internal/randen_detect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static absl::optional<T> ReadSysctlByName(const char* name) {
size_t val_size = sizeof(T);
int ret = sysctlbyname(name, &val, &val_size, nullptr, 0);
if (ret == -1) {
return std::nullopt;
return absl::nullopt;
}
return val;
}
Expand Down

0 comments on commit 9ac7062

Please sign in to comment.