diff --git a/src/basic/meson.build b/src/basic/meson.build index 8fc7665a91..ca27d44be9 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -113,6 +113,7 @@ basic_sources = files(''' missing_securebits.h missing_socket.h missing_stat.h + missing_stdlib.h missing_syscall.h missing_timerfd.h missing_type.h diff --git a/src/basic/missing.h b/src/basic/missing.h index 0651a397c9..15646eaaeb 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -6,7 +6,6 @@ #include #include #include -#include #include #ifndef FS_NOCOW_FL @@ -61,14 +60,6 @@ #define DM_DEFERRED_REMOVE (1 << 17) #endif -#if ! HAVE_SECURE_GETENV -# if HAVE___SECURE_GETENV -# define secure_getenv __secure_getenv -# else -# error "neither secure_getenv nor __secure_getenv are available" -# endif -#endif - #ifndef CIFS_MAGIC_NUMBER # define CIFS_MAGIC_NUMBER 0xFF534D42 #endif @@ -128,6 +119,7 @@ #include "missing_random.h" #include "missing_resource.h" #include "missing_socket.h" +#include "missing_stdlib.h" #include "missing_timerfd.h" #include "missing_type.h" diff --git a/src/basic/missing_stdlib.h b/src/basic/missing_stdlib.h new file mode 100644 index 0000000000..188a8d4406 --- /dev/null +++ b/src/basic/missing_stdlib.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +/* stdlib.h */ +#if !HAVE_SECURE_GETENV +# if HAVE___SECURE_GETENV +# define secure_getenv __secure_getenv +# else +# error "neither secure_getenv nor __secure_getenv are available" +# endif +#endif