Skip to content

Commit

Permalink
fix raw_ptr.cc on exotic architectures (#18193)
Browse files Browse the repository at this point in the history
I was working with an exotic architecture where ABSL_CACHELINE_SIZE of abseil was less than 64, so I got a compilation error about redefined symbols. I think the cc file should be adapted to the header file, so here is my change.

Closes #18193

COPYBARA_INTEGRATE_REVIEW=#18193 from jagub2:raw_ptr_fix 4958e0f
FUTURE_COPYBARA_INTEGRATE_REVIEW=#18193 from jagub2:raw_ptr_fix 4958e0f
PiperOrigin-RevId: 676526640
  • Loading branch information
jagub2 authored and copybara-github committed Sep 19, 2024
1 parent c47de0f commit 38ddc7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/google/protobuf/raw_ptr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "google/protobuf/raw_ptr.h"

#include <algorithm>

#include "absl/base/attributes.h"
#include "absl/base/optimization.h"

Expand All @@ -17,8 +19,8 @@ namespace google {
namespace protobuf {
namespace internal {

ABSL_CONST_INIT PROTOBUF_EXPORT
ABSL_CACHELINE_ALIGNED const char kZeroBuffer[ABSL_CACHELINE_SIZE] = {};
ABSL_CONST_INIT PROTOBUF_EXPORT ABSL_CACHELINE_ALIGNED const char
kZeroBuffer[std::max(ABSL_CACHELINE_SIZE, 64)] = {};

} // namespace internal
} // namespace protobuf
Expand Down

0 comments on commit 38ddc7a

Please sign in to comment.