aboutsummaryrefslogtreecommitdiffstats
path: root/src/serd_config.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-07-09 22:29:55 -0400
committerDavid Robillard <d@drobilla.net>2022-01-13 23:03:49 -0500
commitcc03e614b22b5695a1bbe0bedebd1bf0cf284bf7 (patch)
treee77be535c4dae3c9edade87492e0d0a297d62c9a /src/serd_config.h
parentbf4f881c2241fa8ae6459bd9c8ee6cc83ee563a9 (diff)
downloadserd-cc03e614b22b5695a1bbe0bedebd1bf0cf284bf7.tar.gz
serd-cc03e614b22b5695a1bbe0bedebd1bf0cf284bf7.tar.bz2
serd-cc03e614b22b5695a1bbe0bedebd1bf0cf284bf7.zip
Use thread-safe strerror_r() if available
Diffstat (limited to 'src/serd_config.h')
-rw-r--r--src/serd_config.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/serd_config.h b/src/serd_config.h
index 7f58696e..d5a6db33 100644
--- a/src/serd_config.h
+++ b/src/serd_config.h
@@ -67,6 +67,13 @@
# endif
# endif
+// POSIX.1-2001: strerror_r()
+# ifndef HAVE_STRERROR_R
+# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
+# define HAVE_STRERROR_R
+# endif
+# endif
+
#endif // !defined(SERD_NO_DEFAULT_CONFIG)
/*
@@ -95,4 +102,10 @@
# define USE_POSIX_MEMALIGN 0
#endif
+#ifdef HAVE_STRERROR_R
+# define USE_STRERROR_R 1
+#else
+# define USE_STRERROR_R 0
+#endif
+
#endif // SERD_CONFIG_H