From b07fcde013d1a381d7ba03ac0a3ab47ca22c95f2 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Mon, 28 Jan 2019 12:31:33 -0800 Subject: Fix for C++ inclusion of decoder.int.h. --- upb/pb/decoder.int.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'upb') diff --git a/upb/pb/decoder.int.h b/upb/pb/decoder.int.h index f02bdd5..c9ad551 100644 --- a/upb/pb/decoder.int.h +++ b/upb/pb/decoder.int.h @@ -11,14 +11,8 @@ #include "upb/sink.h" #include "upb/table.int.h" -/* C++ names are not actually used since this type isn't exposed to users. */ -#ifdef __cplusplus -namespace upb { -namespace pb { -class MessageGroup; -} /* namespace pb */ -} /* namespace upb */ -#endif +#ifndef __cplusplus + UPB_DECLARE_DERIVED_TYPE(upb::pb::MessageGroup, upb::RefCounted, mgroup, upb_refcounted) @@ -81,7 +75,7 @@ typedef enum { #define OP_MAX OP_HALT -UPB_INLINE opcode getop(uint32_t instr) { return instr & 0xff; } +UPB_INLINE opcode getop(uint32_t instr) { return (opcode)(instr & 0xff); } /* Method group; represents a set of decoder methods that had their code * emitted together, and must therefore be freed together. Immutable once @@ -328,4 +322,6 @@ UPB_INLINE void upb_pbdecoder_unpackdispatch(uint64_t dispatch, uint64_t *ofs, #define CHECK_RETURN(x) { int32_t ret = x; if (ret >= 0) return ret; } +#endif /* __cplusplus */ + #endif /* UPB_DECODER_INT_H_ */ -- cgit v1.2.3