From 09eb752cf245c33326bc98f8292ec04d477ab121 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 11 Dec 2022 08:53:26 -0500 Subject: Remove unused platform feature checks --- meson.build | 7 +---- src/lilv_config.h | 78 ------------------------------------------------------- src/util.c | 1 + 3 files changed, 2 insertions(+), 84 deletions(-) diff --git a/meson.build b/meson.build index 4920b23..d382ff4 100644 --- a/meson.build +++ b/meson.build @@ -42,13 +42,8 @@ subdir('meson/suppressions') ########################## platform_defines = ['-DLILV_VERSION="@0@"'.format(meson.project_version())] -if host_machine.system() == 'darwin' +if host_machine.system() in ['gnu', 'linux'] platform_defines += [ - '-D_DARWIN_C_SOURCE', - ] -elif host_machine.system() in ['gnu', 'linux'] - platform_defines += [ - '-D_DEFAULT_SOURCE', '-D_POSIX_C_SOURCE=200809L', ] endif diff --git a/src/lilv_config.h b/src/lilv_config.h index cb8ad04..58d4429 100644 --- a/src/lilv_config.h +++ b/src/lilv_config.h @@ -1,90 +1,12 @@ // Copyright 2021 David Robillard // SPDX-License-Identifier: ISC -/* - Configuration header that defines reasonable defaults at compile time. - - This allows compile-time configuration from the command line (typically via - the build system) while still allowing the source to be built without any - configuration. The build system can define LILV_NO_DEFAULT_CONFIG to disable - defaults, in which case it must define things like HAVE_FEATURE to enable - features. The design here ensures that compiler warnings or - include-what-you-use will catch any mistakes. -*/ - #ifndef LILV_CONFIG_H #define LILV_CONFIG_H // Define version unconditionally so a warning will catch a mismatch #define LILV_VERSION "0.24.21" -#if !defined(LILV_NO_DEFAULT_CONFIG) - -// We need unistd.h to check _POSIX_VERSION -# ifndef LILV_NO_POSIX -# ifdef __has_include -# if __has_include() -# include -# endif -# elif defined(__unix__) -# include -# endif -# endif - -// POSIX.1-2001: fileno() -# ifndef HAVE_FILENO -# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L -# define HAVE_FILENO -# endif -# endif - -// Classic UNIX: flock() -# ifndef HAVE_FLOCK -# if defined(__unix__) || defined(__APPLE__) -# define HAVE_FLOCK -# endif -# endif - -// POSIX.1-2001: lstat() -# ifndef HAVE_LSTAT -# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L -# define HAVE_LSTAT -# endif -# endif - -#endif // !defined(LILV_NO_DEFAULT_CONFIG) - -/* - Make corresponding USE_FEATURE defines based on the HAVE_FEATURE defines from - above or the command line. The code checks for these using #if (not #ifdef), - so there will be an undefined warning if it checks for an unknown feature, - and this header is always required by any code that checks for features, even - if the build system defines them all. -*/ - -#ifdef HAVE_FILENO -# define USE_FILENO 1 -#else -# define USE_FILENO 0 -#endif - -#ifdef HAVE_FLOCK -# define USE_FLOCK 1 -#else -# define USE_FLOCK 0 -#endif - -#ifdef HAVE_LSTAT -# define USE_LSTAT 1 -#else -# define USE_LSTAT 0 -#endif - -/* - Define required values. These are always used as a fallback, even with - LILV_NO_DEFAULT_CONFIG, since they must be defined for the build to work. -*/ - // Separator between entries in variables like PATH #ifndef LILV_PATH_SEP # ifdef _WIN32 diff --git a/src/util.c b/src/util.c index b5aed50..0904ce6 100644 --- a/src/util.c +++ b/src/util.c @@ -21,6 +21,7 @@ #include #include #include +#include void lilv_free(void* ptr) -- cgit v1.2.1