commit:     7c1ddcdd1824b74e6b051d3ac4b1f3c1096b8603
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 30 18:04:22 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 30 20:41:32 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c1ddcdd

net-libs/libsmi: fix libsmi.m4 for clang 16

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libsmi/files/libsmi-0.5.0-fix-macro-clang16.patch    | 16 ++++++++++++++++
 .../{libsmi-0.5.0-r3.ebuild => libsmi-0.5.0-r4.ebuild}   |  1 +
 2 files changed, 17 insertions(+)

diff --git a/net-libs/libsmi/files/libsmi-0.5.0-fix-macro-clang16.patch 
b/net-libs/libsmi/files/libsmi-0.5.0-fix-macro-clang16.patch
new file mode 100644
index 000000000000..0ffe6dd92606
--- /dev/null
+++ b/net-libs/libsmi/files/libsmi-0.5.0-fix-macro-clang16.patch
@@ -0,0 +1,16 @@
+stdio needed for sscanf(), stdlib is included by smi.h but let's include it
+anyway for exit().
+--- a/libsmi.m4
++++ b/libsmi.m4
+@@ -12,7 +12,10 @@ AC_DEFUN([AM_PATH_LIBSMI],
+   AC_MSG_CHECKING([whether to enable libsmi])
+   AC_TRY_RUN([ /* libsmi available check */
+ #include <smi.h>
+-main()
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++int main(void)
+ {
+   int current, revision, age, n;
+   const int required = 2;

diff --git a/net-libs/libsmi/libsmi-0.5.0-r3.ebuild 
b/net-libs/libsmi/libsmi-0.5.0-r4.ebuild
similarity index 95%
rename from net-libs/libsmi/libsmi-0.5.0-r3.ebuild
rename to net-libs/libsmi/libsmi-0.5.0-r4.ebuild
index ef7935dddac7..6f190736f93a 100644
--- a/net-libs/libsmi/libsmi-0.5.0-r3.ebuild
+++ b/net-libs/libsmi/libsmi-0.5.0-r4.ebuild
@@ -23,6 +23,7 @@ BDEPEND="
 PATCHES=(
        "${FILESDIR}"/${PN}-0.5.0-implicit-function-declarations.patch
        "${FILESDIR}"/${PN}-0.5.0-clang-15-configure.patch
+       #"${FILESDIR}"/${PN}-0.5.0-fix-macro-clang16.patch
 )
 
 src_prepare() {

Reply via email to