]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Do not provide funopen() on musl
authorGuillem Jover <guillem@hadrons.org>
Tue, 10 Jan 2017 03:33:15 +0000 (04:33 +0100)
committerGuillem Jover <guillem@hadrons.org>
Mon, 5 Jun 2017 03:52:07 +0000 (05:52 +0200)
Fixes: https://bugs.debian.org/818246
configure.ac
src/funopen.c
src/libbsd.map

index 5cbc2fad9a411ff567b9dae8936f3322f9522968..e4d190d355806ca373ff8cd3c453c6ab6f009595 100644 (file)
@@ -51,7 +51,11 @@ AS_CASE([$host_os],
     AC_SEARCH_LIBS([clock_gettime], [rt], [CLOCK_GETTIME_LIBS="-lrt"])
     AC_SUBST([CLOCK_GETTIME_LIBS])
     LIBS="$saved_LIBS"
-  ]
+  ],
+  [*-musl], [
+    # Upstream refuses to define this, we will do it ourselves then.
+    AC_DEFINE([__MUSL__], [1], [Define to 1 if we are building for musl])
+  ],
 )
 
 # Checks for header files.
index 7d6ae31fe342d2107afc0b8ca96bada0ce3cbc93..1e05c7e75188b14974d30ce8f6b74d67d44541b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2011, 2013 Guillem Jover
+ * Copyright © 2011, 2013, 2017 Guillem Jover
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -137,6 +137,12 @@ funopen(const void *cookie,
 
        return fopencookie(cookiewrap, mode, funcswrap);
 }
+#elif defined(__MUSL__)
+/*
+ * This is unimplementable on musl based systems, and upstream has stated
+ * they will not add the needed support to implement it. Just ignore this
+ * interface there, as it has never been provided anyway.
+ */
 #else
-#error "Function funopen() needs to be ported."
+#error "Function funopen() needs to be ported or disabled."
 #endif
index 2b9a3db53189dfa1d7c52c49dea21f26a0c88fd1..304c5933eb5c12b6a7a0c68cb22afaba78cf98ac 100644 (file)
@@ -114,6 +114,9 @@ LIBBSD_0.6 {
 LIBBSD_0.7 {
     getbsize;
 
+    /* This symbol might not be present on some specific systems, such
+     * as musl based ones. It might need to be removed on SOVERSION bump,
+     * as it cannot be portabily implemented everywhere. */
     funopen;
 
     reallocarray;