summaryrefslogtreecommitdiff
path: root/src/basic/missing.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-15 19:06:01 +0100
committerSven Eden <yamakuzure@gmx.net>2017-06-16 10:12:57 +0200
commit5526a2b4ae412d808edde379a370f250f16a73a8 (patch)
tree9532dee127b2a693e542ede3bd1104669378fde8 /src/basic/missing.h
parent321944052ce227a1d9b26d268772c7c076d57960 (diff)
build-sys: fix type detection
Before this patch existence of char16_t, char32_t, key_serial_t was checked with AC_CHECK_DECLS() which doesn't actually work for types. Correct this to use AC_CHECK_TYPES() instead. Also, while we are at it, change the check for memfd_create() to use AC_CHECK_DECLS() instead of AC_CHECK_FUNCS(). This is a better choice, since a couple of syscalls are defined by glibc but not exported in the header files (pivot_root() for example), and we hence should probably be more picky with memfd_create() too, which glibc might decide to expose one day, but not necessarily in the headers too.
Diffstat (limited to 'src/basic/missing.h')
-rw-r--r--src/basic/missing.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/basic/missing.h b/src/basic/missing.h
index 40d0bf01b..0039fb0df 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -169,7 +169,7 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
# endif
#endif
-#ifndef HAVE_MEMFD_CREATE
+#if !HAVE_DECL_MEMFD_CREATE
static inline int memfd_create(const char *name, unsigned int flags) {
return syscall(__NR_memfd_create, name, flags);
}
@@ -1101,7 +1101,7 @@ static inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, uns
#define INPUT_PROP_ACCELEROMETER 0x06
#endif
-#if !HAVE_DECL_KEY_SERIAL_T
+#ifndef HAVE_KEY_SERIAL_T
typedef int32_t key_serial_t;
#endif
@@ -1173,11 +1173,11 @@ static inline key_serial_t request_key(const char *type, const char *description
#ifndef IF_OPER_UP
#define IF_OPER_UP 6
-#ifndef HAVE_DECL_CHAR32_T
+#ifndef HAVE_CHAR32_T
#define char32_t uint32_t
#endif
-#ifndef HAVE_DECL_CHAR16_T
+#ifndef HAVE_CHAR16_T
#define char16_t uint16_t
#endif