On 14.01.16 11:24, Petri Savolainen wrote:
Allways use _GNU_SOURCE instead of various _POSIX_C_SOURCE defines. Signed-off-by: Petri Savolainen <petri.savolai...@nokia.com>
Reviewed-by: Ivan Khoronzhuk <ivan.khoronz...@linaro.org>
--- example/generator/odp_generator.c | 4 +++- example/ipsec/odp_ipsec.c | 6 ++++-- example/ipsec/odp_ipsec_fwd_db.c | 4 +++- example/ipsec/odp_ipsec_sa_db.c | 4 +++- example/ipsec/odp_ipsec_sp_db.c | 4 +++- example/ipsec/odp_ipsec_stream.c | 4 +++- test/performance/odp_l2fwd.c | 4 +++- test/performance/odp_scheduling.c | 3 --- test/validation/timer/timer.c | 5 ++++- 9 files changed, 26 insertions(+), 12 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 757dc54..10643dc 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -5,7 +5,9 @@ */ /** enable strtok */ -#define _POSIX_C_SOURCE 200112L +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include <time.h> #include <stdlib.h> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index fab1035..6426d99 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -10,9 +10,11 @@ * @example odp_example_ipsec.c ODP basic packet IO cross connect with IPsec test application */ -#define _DEFAULT_SOURCE /* enable strtok */ -#define _POSIX_C_SOURCE 200112L +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + #include <stdlib.h> #include <getopt.h> #include <unistd.h> diff --git a/example/ipsec/odp_ipsec_fwd_db.c b/example/ipsec/odp_ipsec_fwd_db.c index 6604e3a..59cb6e4 100644 --- a/example/ipsec/odp_ipsec_fwd_db.c +++ b/example/ipsec/odp_ipsec_fwd_db.c @@ -5,7 +5,9 @@ */ /* enable strtok */ -#define _POSIX_C_SOURCE 200112L +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include <stdlib.h> #include <string.h> diff --git a/example/ipsec/odp_ipsec_sa_db.c b/example/ipsec/odp_ipsec_sa_db.c index 928c4cb..8b2d212 100644 --- a/example/ipsec/odp_ipsec_sa_db.c +++ b/example/ipsec/odp_ipsec_sa_db.c @@ -5,7 +5,9 @@ */ /* enable strtok */ -#define _POSIX_C_SOURCE 200112L +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include <stdlib.h> #include <string.h> diff --git a/example/ipsec/odp_ipsec_sp_db.c b/example/ipsec/odp_ipsec_sp_db.c index 2ce8c93..48874eb 100644 --- a/example/ipsec/odp_ipsec_sp_db.c +++ b/example/ipsec/odp_ipsec_sp_db.c @@ -5,7 +5,9 @@ */ /* enable strtok */ -#define _POSIX_C_SOURCE 200112L +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include <stdlib.h> #include <string.h> diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index f750e18..9c2722e 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -5,7 +5,9 @@ */ /* enable strtok */ -#define _POSIX_C_SOURCE 200112L +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include <stdlib.h> #include <string.h> diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index a85b830..eb83bdb 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -11,7 +11,9 @@ */ /** enable strtok */ -#define _POSIX_C_SOURCE 200112L +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include <stdlib.h> #include <getopt.h> diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index fc6ccdc..8ec89bf 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -10,9 +10,6 @@ * @example odp_example.c ODP example application */ -/* enable clock_gettime */ -#define _POSIX_C_SOURCE 200112L - #include <string.h> #include <stdlib.h> diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c index dda5e4c..5d89700 100644 --- a/test/validation/timer/timer.c +++ b/test/validation/timer/timer.c @@ -9,7 +9,10 @@ */ /* For rand_r and nanosleep */ -#define _POSIX_C_SOURCE 200112L +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + #include <time.h> #include <odp.h> #include "odp_cunit_common.h"
-- Regards, Ivan Khoronzhuk _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp