[ovs-git] [openvswitch/ovs] 274cd1: packets: Fix C++ compilation issues when include p...

GitHub noreply at github.com
Thu Nov 2 18:30:32 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 274cd1f188de5d751ed014169dae54ed64e5c916
      https://github.com/openvswitch/ovs/commit/274cd1f188de5d751ed014169dae54ed64e5c916
  Author: Yi-Hung Wei <yihung.wei at gmail.com>
  Date:   2017-11-02 (Thu, 02 Nov 2017)

  Changed paths:
    M include/openvswitch/util.h
    M lib/packets.h
    M lib/util.h

  Log Message:
  -----------
  packets: Fix C++ compilation issues when include packets.h

This patch fixes three C++ compilation errors when it includes
"lib/packets.h".

1) Fix in "include/openvswitch/util.h" is to avoid duplicated
named_member__ in struct pkt_metadata.

2) Fix in "lib/packets.h" is because designated initializers are not
implemented in GNU C++ [1].

3) Fix in "lib/util.h" is because __builtin_types_compatible_p and
__builtin_choose_expr are only supported in GCC. I use one solution
for C++ that is type-safe and works at compile time from [2].

[1]: https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
[2]: https://goo.gl/xNe48A

Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>




More information about the git mailing list