File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1066,6 +1066,14 @@ class Variant {
1066
1066
1067
1067
// Current type contained in this Variant.
1068
1068
Type type_;
1069
+
1070
+ // Older versions of visual studio cant have this inline in the union and do
1071
+ // sizeof for small string
1072
+ typedef struct {
1073
+ const uint8_t * ptr;
1074
+ size_t size;
1075
+ } BlobValue;
1076
+
1069
1077
// Union of plain old data (scalars or pointers).
1070
1078
union Value {
1071
1079
int64_t int64_value;
@@ -1075,11 +1083,8 @@ class Variant {
1075
1083
std::string* mutable_string_value;
1076
1084
std::vector<Variant>* vector_value;
1077
1085
std::map<Variant, Variant>* map_value;
1078
- struct {
1079
- const uint8_t * ptr;
1080
- size_t size;
1081
- } blob_value;
1082
- char small_string[sizeof (blob_value)];
1086
+ BlobValue blob_value;
1087
+ char small_string[sizeof (BlobValue)];
1083
1088
} value_;
1084
1089
1085
1090
static const size_t kMaxSmallStringSize = sizeof (Value::small_string);
You can’t perform that action at this time.
0 commit comments