clean the fences for the headers:

some headers were not including port_def.inc
some headers were not declaring extern "C"
some headers were backing out of the above in the wrong order

PiperOrigin-RevId: 457391878
pull/13171/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent ca08ff5b74
commit 0c78048723
  1. 4
      upb/alloc.h
  2. 4
      upb/arena.h
  3. 2
      upb/decode.h
  4. 13
      upb/decode_fast.h
  5. 10
      upb/def.h
  6. 6
      upb/encode.h
  7. 7
      upb/extension_registry.h
  8. 5
      upb/json_decode.h
  9. 5
      upb/json_encode.h
  10. 4
      upb/msg.h
  11. 3
      upb/msg_internal.h
  12. 4
      upb/reflection.h
  13. 6
      upb/status.h
  14. 4
      upb/string_view.h
  15. 5
      upb/text_encode.h
  16. 4
      upb/upb.h

@ -89,10 +89,10 @@ UPB_INLINE void* upb_grealloc(void* ptr, size_t oldsize, size_t size) {
UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); }
#include "upb/port_undef.inc"
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_ALLOC_H_ */

@ -157,10 +157,10 @@ UPB_INLINE upb_Arena* upb_Arena_New(void) {
return upb_Arena_Init(NULL, 0, &upb_alloc_global);
}
#include "upb/port_undef.inc"
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_ARENA_H_ */

@ -36,7 +36,7 @@
#include "upb/extension_registry.h"
#include "upb/msg.h"
/* Must be last. */
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus

@ -64,6 +64,13 @@
#include "upb/msg.h"
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct upb_Decoder;
// The fallback, generic parsing function that can handle any field type.
@ -150,4 +157,10 @@ TAGBYTES(r)
#undef UPB_PARSE_PARAMS
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_DECODE_FAST_H_ */

@ -32,12 +32,12 @@
#include "upb/internal/table.h"
#include "upb/upb.h"
/* Must be last. */
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif
struct upb_EnumDef;
typedef struct upb_EnumDef upb_EnumDef;
@ -407,10 +407,10 @@ UPB_INLINE bool _upb_DefPool_LoadDefInit(upb_DefPool* s,
return _upb_DefPool_LoadDefInitEx(s, init, false);
}
#include "upb/port_undef.inc"
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_DEF_H_ */

@ -34,7 +34,7 @@
#include "upb/msg.h"
/* Must be last. */
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
@ -72,10 +72,10 @@ upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l,
int options, upb_Arena* arena, char** buf,
size_t* size);
#include "upb/port_undef.inc"
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_ENCODE_H_ */

@ -28,10 +28,11 @@
#ifndef UPB_EXTENSION_REGISTRY_H_
#define UPB_EXTENSION_REGISTRY_H_
#include <stddef.h>
#include "upb/upb.h"
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
@ -81,4 +82,6 @@ upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_EXTENSION_REGISTRY_H_ */

@ -30,6 +30,9 @@
#include "upb/def.h"
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
@ -44,4 +47,6 @@ bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg,
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_JSONDECODE_H_ */

@ -30,6 +30,9 @@
#include "upb/def.h"
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
@ -62,4 +65,6 @@ size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_JSONENCODE_H_ */

@ -62,10 +62,10 @@ const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
/* Returns the number of extensions present in this message. */
size_t upb_Message_ExtensionCount(const upb_Message* msg);
#include "upb/port_undef.inc"
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_MSG_INT_H_ */

@ -35,7 +35,6 @@
#ifndef UPB_MSG_INT_H_
#define UPB_MSG_INT_H_
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@ -44,7 +43,7 @@
#include "upb/msg.h"
#include "upb/upb.h"
/* Must be last. */
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus

@ -32,9 +32,11 @@
#include "upb/def.h"
#include "upb/map.h"
#include "upb/msg.h"
#include "upb/port_def.inc"
#include "upb/upb.h"
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif

@ -29,8 +29,8 @@
#define UPB_STATUS_H_
#include <stdarg.h>
#include <stdbool.h>
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
@ -57,10 +57,10 @@ void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
va_list args) UPB_PRINTF(2, 0);
#include "upb/port_undef.inc"
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_STATUS_H_ */

@ -64,10 +64,10 @@ UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
#define UPB_STRINGVIEW_FORMAT "%.*s"
#define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data
#include "upb/port_undef.inc"
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_STRING_VIEW_H_ */

@ -30,6 +30,9 @@
#include "upb/def.h"
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
@ -61,4 +64,6 @@ size_t upb_TextEncode(const upb_Message* msg, const upb_MessageDef* m,
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_TEXTENCODE_H_ */

@ -152,10 +152,10 @@ UPB_INLINE int _upb_Log2Ceiling(int x) {
UPB_INLINE int _upb_Log2CeilingSize(int x) { return 1 << _upb_Log2Ceiling(x); }
#include "upb/port_undef.inc"
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UPB_H_ */

Loading…
Cancel
Save