]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
missing: move definition of secure_getenv() to missing_stdlib.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 Dec 2018 05:49:18 +0000 (06:49 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 Dec 2018 12:26:55 +0000 (13:26 +0100)
src/basic/meson.build
src/basic/missing.h
src/basic/missing_stdlib.h [new file with mode: 0644]

index 8fc7665a9132a925f44f3b7a7e263d4ea21b9b8d..ca27d44be99c11cfca5c75e6b9a810549584d98d 100644 (file)
@@ -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
index 0651a397c94c6c56b968eb4f353adb0f1f88a85f..15646eaaeb1daf2d32d8a74e5419c9f0e3d190f9 100644 (file)
@@ -6,7 +6,6 @@
 #include <errno.h>
 #include <inttypes.h>
 #include <linux/falloc.h>
-#include <stdlib.h>
 #include <sys/syscall.h>
 
 #ifndef FS_NOCOW_FL
 #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
 #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 (file)
index 0000000..188a8d4
--- /dev/null
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#include <stdlib.h>
+
+/* 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