Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion modules/opentelemetry/opentelemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@ namespace otelotlp = opentelemetry::exporter::otlp;
#ifdef __cplusplus
/* Relax C-only headers for C++ compilation. */
#define class class_keyword
#undef HAVE_STDATOMIC
#undef HAVE_GENERICS
/* atomic.h defines atomic_t using the C11 keyword `_Atomic(T)` when
* HAVE_STDATOMIC is set. `_Atomic` is C-only and not valid in C++, so
* we shim it to std::atomic<T> for this C++ translation unit. With
* the shim, atomic.h's typedef resolves as
* typedef std::atomic<unsigned long> atomic_t;
* on every architecture. HAVE_STDATOMIC itself is set by Makefile.defs
* or compiler auto-detection, so no change to its value is needed here. */
#include <atomic>
#define _Atomic(T) std::atomic<T>
#endif

extern "C" {
Expand Down
Loading