mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
dpif-netdev: Avoid variable length array on MSVC.
MSVC does not like variable length array either. This patch treats the following error: lib/dpif-netdev.c(2272) : error C2057: expected constant expression lib/dpif-netdev.c(2272) : error C2466: cannot allocate an array of constant size 0 lib/dpif-netdev.c(2272) : error C2133: 'batches' : unknown size lib/dpif-netdev.c(2273) : error C2057: expected constant expression lib/dpif-netdev.c(2273) : error C2466: cannot allocate an array of constant size 0 lib/dpif-netdev.c(2273) : error C2133: 'mfs' : unknown size lib/dpif-netdev.c(2274) : error C2057: expected constant expression lib/dpif-netdev.c(2274) : error C2466: cannot allocate an array of constant size 0 lib/dpif-netdev.c(2274) : error C2133: 'rules' : unknown size lib/dpif-netdev.c(2363) : warning C4034: sizeof returns 0 lib/dpif-netdev.c(2381) : error C2057: expected constant expression lib/dpif-netdev.c(2381) : error C2466: cannot allocate an array of constant size 0 lib/dpif-netdev.c(2381) : error C2133: 'keys' : unknown size make[2]: *** [lib/dpif-netdev.lo] Error 1 Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -2263,10 +2263,10 @@ fast_path_processing(struct dp_netdev *dp, struct emc_cache *flow_cache,
|
||||
struct dpif_packet **packets, size_t cnt,
|
||||
struct pkt_metadata *md, struct netdev_flow_key *keys)
|
||||
{
|
||||
#ifndef __CHECKER__
|
||||
#if !defined(__CHECKER__) && !defined(_WIN32)
|
||||
const size_t PKT_ARRAY_SIZE = cnt;
|
||||
#else
|
||||
/* Sparse doesn't like variable length array */
|
||||
/* Sparse or MSVC doesn't like variable length array. */
|
||||
enum { PKT_ARRAY_SIZE = NETDEV_MAX_RX_BATCH };
|
||||
#endif
|
||||
struct packet_batch batches[PKT_ARRAY_SIZE];
|
||||
@@ -2372,10 +2372,10 @@ static void
|
||||
dp_netdev_input(struct dp_netdev *dp, struct emc_cache *flow_cache,
|
||||
struct dpif_packet **packets, int cnt, struct pkt_metadata *md)
|
||||
{
|
||||
#ifndef __CHECKER__
|
||||
#if !defined(__CHECKER__) && !defined(_WIN32)
|
||||
const size_t PKT_ARRAY_SIZE = cnt;
|
||||
#else
|
||||
/* Sparse doesn't like variable length array */
|
||||
/* Sparse or MSVC doesn't like variable length array. */
|
||||
enum { PKT_ARRAY_SIZE = NETDEV_MAX_RX_BATCH };
|
||||
#endif
|
||||
struct netdev_flow_key keys[PKT_ARRAY_SIZE];
|
||||
|
Reference in New Issue
Block a user