Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 330b48b

Browse files
committed
Separate enum from struct
Otherwise the enum symbols are not visible outside the struct in C++. Reviewed-by: Thomas Munro <[email protected]>
1 parent 0665023 commit 330b48b

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/include/utils/jsonb.h

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,20 @@ typedef struct
219219
#define JB_ROOT_IS_ARRAY(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FARRAY)
220220

221221

222+
enum jbvType
223+
{
224+
/* Scalar types */
225+
jbvNull = 0x0,
226+
jbvString,
227+
jbvNumeric,
228+
jbvBool,
229+
/* Composite types */
230+
jbvArray = 0x10,
231+
jbvObject,
232+
/* Binary (i.e. struct Jsonb) jbvArray/jbvObject */
233+
jbvBinary
234+
};
235+
222236
/*
223237
* JsonbValue: In-memory representation of Jsonb. This is a convenient
224238
* deserialized representation, that can easily support using the "val"
@@ -227,19 +241,7 @@ typedef struct
227241
*/
228242
struct JsonbValue
229243
{
230-
enum
231-
{
232-
/* Scalar types */
233-
jbvNull = 0x0,
234-
jbvString,
235-
jbvNumeric,
236-
jbvBool,
237-
/* Composite types */
238-
jbvArray = 0x10,
239-
jbvObject,
240-
/* Binary (i.e. struct Jsonb) jbvArray/jbvObject */
241-
jbvBinary
242-
} type; /* Influences sort order */
244+
jbvType type; /* Influences sort order */
243245

244246
union
245247
{

0 commit comments

Comments
 (0)