eal: fix keep alive header for C++
authorThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 5 Feb 2016 16:14:17 +0000 (17:14 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 21 Feb 2016 10:46:48 +0000 (11:46 +0100)
commit1a8dbad49a9f053c35452a8e448344239a724651
tree8c8ff35ceec3a78f4a481ec46770e848a25b6912
parent2f29ce885a999549324c4189796a0688e0c9b653
eal: fix keep alive header for C++

When built in a C++ application, the keepalive include fails:

rte_keepalive.h:142:41: error: ‘ALIVE’ was not declared in this scope
  keepcfg->state_flags[rte_lcore_id()] = ALIVE;
                                         ^
C++ requires to use a scope operator to access an enum inside a struct.
There was also a namespace issue for the values (no RTE prefix).
The solution is to move the struct and related code out of the header file.

Fixes: 75583b0d1efd ("eal: add keep alive monitoring")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
lib/librte_eal/common/include/rte_keepalive.h
lib/librte_eal/common/rte_keepalive.c