[ovs-dev] [PATCH] types: Define OVS_*128_MAX statically.

Joe Stringer joe at ovn.org
Tue Dec 22 00:11:26 UTC 2015


On 21 December 2015 at 16:01, Ben Pfaff <blp at ovn.org> wrote:
> On Mon, Dec 21, 2015 at 03:56:40PM -0800, Joe Stringer wrote:
>> The previous definitions of these variables using designated
>> initializers caused a variety of issues when attempting to compile with
>> MSVC, particularly if including these headers from C++ code. By defining
>> them like this, we can appease MSVC and keep the definitions the same on
>> all platforms.
>>
>> VMware-BZ: #1517163
>> Suggested-by: Yin Lin <linyi at vmware.com>
>> Signed-off-by: Joe Stringer <joe at ovn.org>
>
> Why not just use a new-enough MSVC?  According to this discussion of the
> topic, MSVC 2013 and newer support designated initializers in C++:
>         http://stackoverflow.com/questions/18731707/why-does-c11-not-support-designated-initializer-list-as-c99

We have encountered this issue on MSVC2013u3 and MSVC2015u1. As far as
I can tell, the compiler will accept them if it is compiling a .c
file, but it fails if the header is included from a .cpp file.



More information about the dev mailing list