From 33d320ab80aebb89dc63931684ef2e748b5fb91c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 1 Feb 2019 11:01:42 -0500 Subject: util: Allow configuration macros to be specified with -D In case we need to override them at build time. --- util.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index 6a51806..332fb79 100644 --- a/util.h +++ b/util.h @@ -39,12 +39,29 @@ # define BFS_HAS_INCLUDE(header, fallback) fallback #endif -#define BFS_HAS_MNTENT BFS_HAS_INCLUDE(, __GLIBC__) -#define BFS_HAS_SYS_ACL BFS_HAS_INCLUDE(, true) -#define BFS_HAS_SYS_CAPABILITY BFS_HAS_INCLUDE(, __linux__) -#define BFS_HAS_SYS_MKDEV BFS_HAS_INCLUDE(, false) -#define BFS_HAS_SYS_PARAM BFS_HAS_INCLUDE(, true) -#define BFS_HAS_SYS_SYSMACROS BFS_HAS_INCLUDE(, __GLIBC__) +#ifndef BFS_HAS_MNTENT +# define BFS_HAS_MNTENT BFS_HAS_INCLUDE(, __GLIBC__) +#endif + +#ifndef BFS_HAS_SYS_ACL +# define BFS_HAS_SYS_ACL BFS_HAS_INCLUDE(, true) +#endif + +#ifndef BFS_HAS_SYS_CAPABILITY +# define BFS_HAS_SYS_CAPABILITY BFS_HAS_INCLUDE(, __linux__) +#endif + +#ifndef BFS_HAS_SYS_MKDEV +# define BFS_HAS_SYS_MKDEV BFS_HAS_INCLUDE(, false) +#endif + +#ifndef BFS_HAS_SYS_PARAM +# define BFS_HAS_SYS_PARAM BFS_HAS_INCLUDE(, true) +#endif + +#ifndef BFS_HAS_SYS_SYSMACROS +# define BFS_HAS_SYS_SYSMACROS BFS_HAS_INCLUDE(, __GLIBC__) +#endif #if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE) # define FNM_CASEFOLD FNM_IGNORECASE -- cgit v1.2.3