} be64;
} ovs_be128;
-#define OVS_U128_MAX (ovs_u128) { .u64 = { UINT64_MAX, UINT64_MAX } }
-#define OVS_BE128_MAX (ovs_be128) { .be64 = { OVS_BE64_MAX, OVS_BE64_MAX } }
+/* MSVC2015 doesn't support designated initializers when compiling C++,
+ * and doesn't support ternary operators with non-designated initializers.
+ * So we use these static definitions rather than using initializer macros. */
+static const ovs_u128 OVS_U128_MAX = { { UINT32_MAX, UINT32_MAX,
+ UINT32_MAX, UINT32_MAX } };
+static const ovs_be128 OVS_BE128_MAX = { { OVS_BE32_MAX, OVS_BE32_MAX,
+ OVS_BE32_MAX, OVS_BE32_MAX } };
/* A 64-bit value, in network byte order, that is only aligned on a 32-bit
* boundary. */
static inline bool
ovs_u128_is_ones(const ovs_u128 *val)
{
- ovs_u128 ones = OVS_U128_MAX;
-
- return ovs_u128_equals(val, &ones);
+ return ovs_u128_equals(val, &OVS_U128_MAX);
}
/* Returns non-zero if the parameters have equal value. */