summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-12-28 16:20:12 +0100
committerThomas Haller <thaller@redhat.com>2019-01-02 11:51:42 +0100
commit5f945adfaf8a2c9c34cd14209727dba4ef3284d8 (patch)
tree577766af8f7cf2ea3fa5c9d44a48eeaeeb62e1e3
parent066357aa4766315fe9b9ed83f6cf16d9b87c6944 (diff)
downloadNetworkManager-5f945adfaf8a2c9c34cd14209727dba4ef3284d8.tar.gz
systemd: drop workaround for missing C11 header <uchar.h>
Now as we build as C11, we can us it.
-rw-r--r--Makefile.am2
-rw-r--r--src/systemd/sd-adapt/missing_type.h3
-rw-r--r--src/systemd/sd-adapt/nm-sd-adapt.h10
-rw-r--r--src/systemd/src/basic/escape.h2
-rw-r--r--src/systemd/src/basic/missing_type.h12
-rw-r--r--src/systemd/src/basic/utf8.h2
6 files changed, 17 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index 9280f3fa9b..fe3c1eca4f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1550,7 +1550,6 @@ src_libsystemd_nm_la_SOURCES = \
src/systemd/sd-adapt/missing_socket.h \
src/systemd/sd-adapt/missing_syscall.h \
src/systemd/sd-adapt/missing_timerfd.h \
- src/systemd/sd-adapt/missing_type.h \
src/systemd/sd-adapt/mkdir.h \
src/systemd/sd-adapt/procfs-util.h \
src/systemd/sd-adapt/raw-clone.h \
@@ -1599,6 +1598,7 @@ src_libsystemd_nm_la_SOURCES = \
src/systemd/src/basic/macro.h \
src/systemd/src/basic/mempool.c \
src/systemd/src/basic/mempool.h \
+ src/systemd/src/basic/missing_type.h \
src/systemd/src/basic/parse-util.c \
src/systemd/src/basic/parse-util.h \
src/systemd/src/basic/path-util.c \
diff --git a/src/systemd/sd-adapt/missing_type.h b/src/systemd/sd-adapt/missing_type.h
deleted file mode 100644
index 637892c2d6..0000000000
--- a/src/systemd/sd-adapt/missing_type.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#pragma once
-
-/* dummy header */
diff --git a/src/systemd/sd-adapt/nm-sd-adapt.h b/src/systemd/sd-adapt/nm-sd-adapt.h
index 72dcb45888..cd2d202590 100644
--- a/src/systemd/sd-adapt/nm-sd-adapt.h
+++ b/src/systemd/sd-adapt/nm-sd-adapt.h
@@ -44,6 +44,10 @@
#define HAVE_SYS_AUXV_H 0
#endif
+/* we build with C11 and thus <uchar.h> provides char32_t,char16_t. */
+#define HAVE_CHAR32_T 1
+#define HAVE_CHAR16_T 1
+
/*****************************************************************************/
static inline NMLogLevel
@@ -151,12 +155,6 @@ raw_getpid (void) {
/*****************************************************************************/
-/* work around missing uchar.h */
-typedef guint16 char16_t;
-typedef guint32 char32_t;
-
-/*****************************************************************************/
-
static inline int
sd_notify (int unset_environment, const char *state)
{
diff --git a/src/systemd/src/basic/escape.h b/src/systemd/src/basic/escape.h
index cc6a897c49..515620993d 100644
--- a/src/systemd/src/basic/escape.h
+++ b/src/systemd/src/basic/escape.h
@@ -5,9 +5,7 @@
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
-#if 0 /* NM_IGNORED */
#include <uchar.h>
-#endif /* NM_IGNORED */
#include "string-util.h"
#include "missing_type.h"
diff --git a/src/systemd/src/basic/missing_type.h b/src/systemd/src/basic/missing_type.h
new file mode 100644
index 0000000000..bf8a6caa1b
--- /dev/null
+++ b/src/systemd/src/basic/missing_type.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#include <uchar.h>
+
+#if !HAVE_CHAR32_T
+#define char32_t uint32_t
+#endif
+
+#if !HAVE_CHAR16_T
+#define char16_t uint16_t
+#endif
diff --git a/src/systemd/src/basic/utf8.h b/src/systemd/src/basic/utf8.h
index eedfebe39c..628456936e 100644
--- a/src/systemd/src/basic/utf8.h
+++ b/src/systemd/src/basic/utf8.h
@@ -4,9 +4,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
-#if 0 /* NM_IGNORED */
#include <uchar.h>
-#endif /* NM_IGNORED */
#include "macro.h"
#include "missing_type.h"