Browse code

core: workaround related to T_OPT for alpine linux musl C library (GH #2095)

Henning Westerholt authored on 07/10/2019 13:38:22
Showing 1 changed files
... ...
@@ -32,8 +32,12 @@
32 32
 #include <resolv.h>
33 33
 #include <string.h>
34 34
 
35
-/* older glibc < 2.25 does not include T_OPT in nameser_compat.h yet */
36
-#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 25
35
+/*
36
+ * Older glibc < 2.25 does not include T_OPT in nameser_compat.h yet.
37
+ * On alpine linux musl library it is also not defined. There is no
38
+ * musl feature test macro, so we look for glibc instead.
39
+ */
40
+#if (defined __GLIBC__ &&  __GLIBC__ == 2 && __GLIBC_MINOR__ < 25) || !defined __GLIBC__
37 41
 #ifndef T_OPT
38 42
 #define T_OPT ns_t_opt
39 43
 #endif