mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
Wrap C++ headers in #ifdef __cplusplus.
The upb libraries can also be accessed from Kotlin Native code, which understands only C headers, not C++. By adding these `#ifdef` directives, the C++ headers will appear to be empty in that case. PiperOrigin-RevId: 599593286
This commit is contained in:
parent
d98722b53c
commit
fc2d9da9c0
2 changed files with 8 additions and 0 deletions
|
|
@ -8,6 +8,8 @@
|
|||
#ifndef UPB_BASE_STATUS_HPP_
|
||||
#define UPB_BASE_STATUS_HPP_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "upb/base/status.h"
|
||||
|
||||
namespace upb {
|
||||
|
|
@ -47,4 +49,6 @@ class Status final {
|
|||
|
||||
} // namespace upb
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // UPB_BASE_STATUS_HPP_
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
#ifndef UPB_MEM_ARENA_HPP_
|
||||
#define UPB_MEM_ARENA_HPP_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "upb/mem/arena.h"
|
||||
|
|
@ -51,4 +53,6 @@ class InlinedArena : public Arena {
|
|||
|
||||
} // namespace upb
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // UPB_MEM_ARENA_HPP_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue