[v6,04/17] build: remove redundant _GNU_SOURCE definitions
Checks
Commit Message
The feature macro _GNU_SOURCE is defined globally,
but there was some remaining useless settings.
The internal definition in config/meson.build is kept,
all other internal definitions of _GNU_SOURCE are removed,
except in examples, which can be built as external applications.
Note: external applications do not inherit of _GNU_SOURCE.
Fixes: 5d7b673d5fd6 ("mk: build with _GNU_SOURCE defined by default")
Fixes: 28188cee2aa0 ("build: enable BSD features visibility for FreeBSD")
Fixes: e6cdc54cc0ef ("net/mlx5: add socket server for external tools")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test/meson.build | 2 --
drivers/bus/fslmc/qbman/include/compat.h | 3 ---
drivers/common/dpaax/compat.h | 4 ----
drivers/common/dpaax/meson.build | 1 -
drivers/net/memif/rte_eth_memif.h | 4 ----
drivers/net/mlx5/linux/mlx5_socket.c | 4 ----
6 files changed, 18 deletions(-)
@@ -398,8 +398,6 @@ if cc.has_argument('-Wno-format-truncation')
cflags += '-Wno-format-truncation'
endif
-# specify -D_GNU_SOURCE unconditionally
-cflags += '-D_GNU_SOURCE'
# Strict-aliasing rules are violated by uint8_t[] to context size casts.
cflags += '-fno-strict-aliasing'
@@ -8,9 +8,6 @@
#ifndef HEADER_COMPAT_H
#define HEADER_COMPAT_H
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -10,10 +10,6 @@
#define __COMPAT_H
#include <sched.h>
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
@@ -10,7 +10,6 @@ sources = files('dpaax_iova_table.c', 'dpaa_of.c', 'caamflib.c')
includes += include_directories('caamflib')
-cflags += ['-D_GNU_SOURCE']
if cc.has_argument('-Wno-cast-qual')
cflags += '-Wno-cast-qual'
endif
@@ -5,10 +5,6 @@
#ifndef _RTE_ETH_MEMIF_H_
#define _RTE_ETH_MEMIF_H_
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif /* GNU_SOURCE */
-
#include <sys/queue.h>
#include <ethdev_driver.h>
@@ -2,10 +2,6 @@
* Copyright 2019 Mellanox Technologies, Ltd
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>