aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/ladish/patches/musl-no-dlvsym.patch
blob: c63709f436189e29fe9e5690ffb11740c2e595a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- a/alsapid/lib.c	2016-06-06 16:35:46.734195397 +0200
+++ b/alsapid/lib.c	2016-06-06 16:35:54.209195783 +0200
@@ -73,16 +73,29 @@
 //static int (* real_snd_seq_create_port)(snd_seq_t * handle, snd_seq_port_info_t * info);
 //static int (* real_snd_seq_create_simple_port)(snd_seq_t * seq, const char * name, unsigned int caps, unsigned int type);
 
-#define CHECK_FUNC(func)                                                \
-  if (real_ ## func == NULL)                                            \
-  {                                                                     \
-    real_ ## func = dlvsym(RTLD_NEXT, #func, API_VERSION);              \
-    if (real_ ## func == NULL)                                          \
-    {                                                                   \
-      fprintf(stderr, "dlvsym(\""#func"\", \""API_VERSION"\") failed. %s\n", dlerror()); \
-      return -1;                                                        \
-    }                                                                   \
-  }
+#if defined(__GLIBC__)
+  #define CHECK_FUNC(func)                                                \
+    if (real_ ## func == NULL)                                            \
+    {                                                                     \
+      real_ ## func = dlvsym(RTLD_NEXT, #func, API_VERSION);              \
+      if (real_ ## func == NULL)                                          \
+      {                                                                   \
+        fprintf(stderr, "dlvsym(\""#func"\", \""API_VERSION"\") failed. %s\n", dlerror()); \
+        return -1;                                                        \
+      }                                                                   \
+    }
+#else
+  #define CHECK_FUNC(func)                                                \
+    if (real_ ## func == NULL)                                            \
+    {                                                                     \
+      real_ ## func = dlsym(RTLD_NEXT, #func);                            \
+      if (real_ ## func == NULL)                                          \
+      {                                                                   \
+        fprintf(stderr, "dlsym(\""#func"\") failed. %s\n", dlerror());    \
+        return -1;                                                        \
+      }                                                                   \
+    }
+#endif
 
 #if 0
 LADISH_PUBLIC