Fix include portablity (xlocale, stdlib)
authorGreg V <greg@unrelenting.technology>
Tue, 10 Jul 2018 10:56:18 +0000 (13:56 +0300)
committerGreg V <greg@unrelenting.technology>
Mon, 16 Jul 2018 10:44:15 +0000 (13:44 +0300)
meson.build
src/libinput-util.h

index 9ff1711..e3d81da 100644 (file)
@@ -87,6 +87,10 @@ if cc.has_header_symbol('dirent.h', 'versionsort', prefix : prefix)
        config_h.set('HAVE_VERSIONSORT', '1')
 endif
 
+if cc.has_header('xlocale.h')
+       config_h.set('HAVE_XLOCALE_H', '1')
+endif
+
 # Dependencies
 pkgconfig = import('pkgconfig')
 dep_udev = dependency('libudev')
index c68b888..85166ca 100644 (file)
 #include <errno.h>
 #include <limits.h>
 #include <locale.h>
+#ifdef HAVE_XLOCALE_H
+#include <xlocale.h>
+#endif
 #include <math.h>
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <time.h>
 #include <unistd.h>