summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2016-09-30 16:00:00 +0000
committerPeter Eisentraut2016-09-30 19:11:47 +0000
commit330b48b94b53bcbbc490f952d6798d5ab637721a (patch)
treebcf470113e0bdd104ed78c080e736a51734846f8
parent0665023b4435a469e42289d7065c436967a022b6 (diff)
Separate enum from struct
Otherwise the enum symbols are not visible outside the struct in C++. Reviewed-by: Thomas Munro <[email protected]>
-rw-r--r--src/include/utils/jsonb.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index fa52afcb5c..48ca9dc913 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -219,6 +219,20 @@ typedef struct
#define JB_ROOT_IS_ARRAY(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FARRAY)
+enum jbvType
+{
+ /* Scalar types */
+ jbvNull = 0x0,
+ jbvString,
+ jbvNumeric,
+ jbvBool,
+ /* Composite types */
+ jbvArray = 0x10,
+ jbvObject,
+ /* Binary (i.e. struct Jsonb) jbvArray/jbvObject */
+ jbvBinary
+};
+
/*
* JsonbValue: In-memory representation of Jsonb. This is a convenient
* deserialized representation, that can easily support using the "val"
@@ -227,19 +241,7 @@ typedef struct
*/
struct JsonbValue
{
- enum
- {
- /* Scalar types */
- jbvNull = 0x0,
- jbvString,
- jbvNumeric,
- jbvBool,
- /* Composite types */
- jbvArray = 0x10,
- jbvObject,
- /* Binary (i.e. struct Jsonb) jbvArray/jbvObject */
- jbvBinary
- } type; /* Influences sort order */
+ jbvType type; /* Influences sort order */
union
{