diff options
author | John Levon <john.levon@nutanix.com> | 2021-03-23 15:56:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 15:56:59 +0000 |
commit | c0c891a19d78ba8881f9bc77013bdfd583e223f2 (patch) | |
tree | 0f9df8e72efb22ac027ad91e6898dfb2082bd088 | |
parent | 9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79 (diff) | |
download | libvfio-user-c0c891a19d78ba8881f9bc77013bdfd583e223f2.zip libvfio-user-c0c891a19d78ba8881f9bc77013bdfd583e223f2.tar.gz libvfio-user-c0c891a19d78ba8881f9bc77013bdfd583e223f2.tar.bz2 |
globally define _GNU_SOURCE (#401)
This avoids any issues with multiple definitions when passing CFLAGS in.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/libvfio-user.c | 1 | ||||
-rw-r--r-- | lib/tran_sock.c | 1 | ||||
-rw-r--r-- | samples/client.c | 1 | ||||
-rw-r--r-- | samples/server.c | 1 |
5 files changed, 1 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 72c2063..8715625 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb") set(CMAKE_C_FLAGS_RELEASE "-O3") set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} -Wall -Werror -Wextra ") + "${CMAKE_C_FLAGS} -D_GNU_SOURCE -Wall -Werror -Wextra") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers -Wmissing-declarations") diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index 8df125f..3140a75 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -30,7 +30,6 @@ * */ -#define _GNU_SOURCE #include <stdbool.h> #include <stdint.h> #include <stdio.h> diff --git a/lib/tran_sock.c b/lib/tran_sock.c index fd0dbb6..3e90576 100644 --- a/lib/tran_sock.c +++ b/lib/tran_sock.c @@ -30,7 +30,6 @@ * */ -#define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <limits.h> diff --git a/samples/client.c b/samples/client.c index 309c193..94702d5 100644 --- a/samples/client.c +++ b/samples/client.c @@ -28,7 +28,6 @@ * */ -#define _GNU_SOURCE #include <stdio.h> #include <sys/socket.h> #include <sys/un.h> diff --git a/samples/server.c b/samples/server.c index ecf5c49..d5318a3 100644 --- a/samples/server.c +++ b/samples/server.c @@ -29,7 +29,6 @@ * */ -#define _GNU_SOURCE #include <stdio.h> #include <err.h> #include <stdlib.h> |