fix raw_ptr.cc on exotic architectures (#18193)

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=https://github.com/protocolbuffers/protobuf/pull/18193 from jagub2:raw_ptr_fix 4958e0f85e
PiperOrigin-RevId: 676543711
pull/18426/head
Jakub 4 months ago committed by Copybara-Service
parent bbbc7b9671
commit 63f6262c93
  1. 6
      src/google/protobuf/raw_ptr.cc

@ -7,6 +7,8 @@
#include "google/protobuf/raw_ptr.h"
#include <algorithm>
#include "absl/base/attributes.h"
#include "absl/base/optimization.h"
@ -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

Loading…
Cancel
Save