On 21 December 2015 at 22:43, Ben Pfaff <b...@ovn.org> wrote: > On Mon, Dec 21, 2015 at 04:45:20PM -0800, Joe Stringer wrote: >> On 21 December 2015 at 16:11, Joe Stringer <j...@ovn.org> wrote: >> > On 21 December 2015 at 16:01, Ben Pfaff <b...@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 <li...@vmware.com> >> >>> Signed-off-by: Joe Stringer <j...@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. >> >> This page seems to confirm that designated initializers are only >> supported in C mode: >> http://blogs.msdn.com/b/vcblog/archive/2015/04/29/c-11-14-17-features-in-vs-2015-rc.aspx > > It is a shame that Microsoft doesn't bother to actually document any of > this, at least not accurately. (Their one page on "extensions" > documents // comments as an extension, even though they've been part of > C for the past 16 years!) Apparently we're supposed to refer to a blog > for documentation?
Blogging is the hip way to document things these days ;) > Ugh. You'd better add a comment so that no one changes this back to a > sane definition. Sure thing. > Acked-by: Ben Pfaff <b...@ovn.org> Thanks, I'll apply this soon. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev