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
pull/15478/head
Éamonn McManus 1 year ago committed by Copybara-Service
parent d98722b53c
commit fc2d9da9c0
  1. 4
      upb/base/status.hpp
  2. 4
      upb/mem/arena.hpp

@ -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…
Cancel
Save