Separate enum from struct

Otherwise the enum symbols are not visible outside the struct in C++.

Reviewed-by: Thomas Munro <thomas.munro@enterprisedb.com>
This commit is contained in:
Peter Eisentraut 2016-09-30 12:00:00 -04:00
parent 0665023b44
commit 330b48b94b
1 changed files with 15 additions and 13 deletions

View File

@ -219,16 +219,8 @@ typedef struct
#define JB_ROOT_IS_ARRAY(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FARRAY) #define JB_ROOT_IS_ARRAY(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FARRAY)
/* enum jbvType
* JsonbValue: In-memory representation of Jsonb. This is a convenient
* deserialized representation, that can easily support using the "val"
* union across underlying types during manipulation. The Jsonb on-disk
* representation has various alignment considerations.
*/
struct JsonbValue
{ {
enum
{
/* Scalar types */ /* Scalar types */
jbvNull = 0x0, jbvNull = 0x0,
jbvString, jbvString,
@ -239,7 +231,17 @@ struct JsonbValue
jbvObject, jbvObject,
/* Binary (i.e. struct Jsonb) jbvArray/jbvObject */ /* Binary (i.e. struct Jsonb) jbvArray/jbvObject */
jbvBinary jbvBinary
} type; /* Influences sort order */ };
/*
* JsonbValue: In-memory representation of Jsonb. This is a convenient
* deserialized representation, that can easily support using the "val"
* union across underlying types during manipulation. The Jsonb on-disk
* representation has various alignment considerations.
*/
struct JsonbValue
{
jbvType type; /* Influences sort order */
union union
{ {