chiark / gitweb /
__thread --> thread_local for C11 compat
[elogind.git] / src / libsystemd-id128 / sd-id128.c
index 3fbad71a52b91a1679718c58334ac3da5f1424f6..9ee40ab91eaaee64a3f13dc61dc354bc8de26400 100644 (file)
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "sd-id128.h"
-
 #include "util.h"
 #include "macro.h"
+#include "sd-id128.h"
 
 _public_ char *sd_id128_to_string(sd_id128_t id, char s[33]) {
         unsigned n;
@@ -105,8 +104,8 @@ static sd_id128_t make_v4_uuid(sd_id128_t id) {
 }
 
 _public_ int sd_id128_get_machine(sd_id128_t *ret) {
-        static __thread sd_id128_t saved_machine_id;
-        static __thread bool saved_machine_id_valid = false;
+        static thread_local sd_id128_t saved_machine_id;
+        static thread_local bool saved_machine_id_valid = false;
         _cleanup_close_ int fd = -1;
         char buf[33];
         ssize_t k;
@@ -154,8 +153,8 @@ _public_ int sd_id128_get_machine(sd_id128_t *ret) {
 }
 
 _public_ int sd_id128_get_boot(sd_id128_t *ret) {
-        static __thread sd_id128_t saved_boot_id;
-        static __thread bool saved_boot_id_valid = false;
+        static thread_local sd_id128_t saved_boot_id;
+        static thread_local bool saved_boot_id_valid = false;
         _cleanup_close_ int fd = -1;
         char buf[36];
         ssize_t k;