mem: fix build
authorThomas Monjalon <thomas@monjalon.net>
Sun, 26 Apr 2020 10:40:46 +0000 (12:40 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 26 Apr 2020 11:27:08 +0000 (13:27 +0200)
Some compilers (on RHEL7 and CentOS7) were getting this error:
error: "RTE_EXEC_ENV_FREEBSD" is not defined [-Werror=undef]

Existence of a macro must be checked with "#ifdef" or "#if defined".

Fixes: d72e4042c5eb ("mem: exclude unused memory from core dump")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Raslan Darawsheh <rasland@mellanox.com>
lib/librte_eal/common/eal_common_memory.c

index 9a797a4..4c897a1 100644 (file)
@@ -42,7 +42,7 @@ static uint64_t system_page_sz;
 
 #ifdef RTE_EXEC_ENV_LINUX
 #define RTE_DONTDUMP MADV_DONTDUMP
-#elif RTE_EXEC_ENV_FREEBSD
+#elif defined RTE_EXEC_ENV_FREEBSD
 #define RTE_DONTDUMP MADV_NOCORE
 #else
 #error "madvise doesn't support this OS"