summaryrefslogtreecommitdiff
path: root/upb/pb
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-03-27 15:32:05 -0700
committerGitHub <noreply@github.com>2019-03-27 15:32:05 -0700
commitcf35baa1ad70f0dca734f93bcc2b54d8d059bcdd (patch)
tree3c9881fcceaba1dbb5f04fe01ddc5f2dc5c647d1 /upb/pb
parent928ef7f2c02f18d9945dd750884dffbdebef1b98 (diff)
Moved macros from upb.h to port_def.inc to avoid leaking them to users. (#160)
* Use port_def.inc to prevent macros from leaking to users. * Added helpful comments to port_def.inc/port_undef.inc.
Diffstat (limited to 'upb/pb')
-rw-r--r--upb/pb/compile_decoder.c2
-rw-r--r--upb/pb/decoder.c2
-rw-r--r--upb/pb/decoder.int.h4
-rw-r--r--upb/pb/encoder.c1
-rw-r--r--upb/pb/textprinter.c2
-rw-r--r--upb/pb/varint.int.h4
6 files changed, 15 insertions, 0 deletions
diff --git a/upb/pb/compile_decoder.c b/upb/pb/compile_decoder.c
index 89f000a..a7d1ac3 100644
--- a/upb/pb/compile_decoder.c
+++ b/upb/pb/compile_decoder.c
@@ -15,6 +15,8 @@
#include <stdio.h>
#endif
+#include "upb/port_def.inc"
+
#define MAXLABEL 5
#define EMPTYLABEL -1
diff --git a/upb/pb/decoder.c b/upb/pb/decoder.c
index 2384312..a7a5e7b 100644
--- a/upb/pb/decoder.c
+++ b/upb/pb/decoder.c
@@ -22,6 +22,8 @@
#include <stdio.h>
#endif
+#include "upb/port_def.inc"
+
#define CHECK_SUSPEND(x) if (!(x)) return upb_pbdecoder_suspend(d);
/* Error messages that are shared between the bytecode and JIT decoders. */
diff --git a/upb/pb/decoder.int.h b/upb/pb/decoder.int.h
index 42fd7f8..3ed50df 100644
--- a/upb/pb/decoder.int.h
+++ b/upb/pb/decoder.int.h
@@ -11,6 +11,8 @@
#include "upb/sink.h"
#include "upb/table.int.h"
+#include "upb/port_def.inc"
+
/* Opcode definitions. The canonical meaning of each opcode is its
* implementation in the interpreter (the JIT is written to match this).
*
@@ -303,4 +305,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; }
+#include "upb/port_undef.inc"
+
#endif /* UPB_DECODER_INT_H_ */
diff --git a/upb/pb/encoder.c b/upb/pb/encoder.c
index 5f74010..e7092a8 100644
--- a/upb/pb/encoder.c
+++ b/upb/pb/encoder.c
@@ -57,6 +57,7 @@
#include "upb/pb/encoder.h"
#include "upb/pb/varint.int.h"
+#include "upb/port_def.inc"
/* The output buffer is divided into segments; a segment is a string of data
* that is "ready to go" -- it does not need any varint lengths inserted into
diff --git a/upb/pb/textprinter.c b/upb/pb/textprinter.c
index 934130e..7aafffc 100644
--- a/upb/pb/textprinter.c
+++ b/upb/pb/textprinter.c
@@ -16,6 +16,8 @@
#include "upb/sink.h"
+#include "upb/port_def.inc"
+
struct upb_textprinter {
upb_sink input_;
upb_bytessink output_;
diff --git a/upb/pb/varint.int.h b/upb/pb/varint.int.h
index b216a94..ddda694 100644
--- a/upb/pb/varint.int.h
+++ b/upb/pb/varint.int.h
@@ -11,6 +11,8 @@
#include <string.h>
#include "upb/upb.h"
+#include "upb/port_def.inc"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -153,4 +155,6 @@ UPB_INLINE uint64_t upb_vencode32(uint32_t val) {
} /* extern "C" */
#endif
+#include "upb/port_undef.inc"
+
#endif /* UPB_VARINT_DECODER_H_ */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback