From 5c0244625f18d48a121882c7e1a47444a5a86a50 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 15 Oct 2024 19:12:58 +0200 Subject: [PATCH] adding for_autoconf() C function for autoconf AC_CHECK_LIB feature --- src/libdar/get_version.cpp | 9 +++++++++ src/libdar/get_version.hpp | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/libdar/get_version.cpp b/src/libdar/get_version.cpp index c9071672..bd63249a 100644 --- a/src/libdar/get_version.cpp +++ b/src/libdar/get_version.cpp @@ -287,3 +287,12 @@ namespace libdar } // end of namespace + +extern "C" +{ + unsigned int for_autoconf(unsigned int x) + { + return x+1; + } +} + diff --git a/src/libdar/get_version.hpp b/src/libdar/get_version.hpp index f618c548..5c2415d5 100644 --- a/src/libdar/get_version.hpp +++ b/src/libdar/get_version.hpp @@ -149,4 +149,14 @@ namespace libdar } // end of namespace +extern "C" +{ + /// in case you use autoconf AC_CHECK_LIB in your program to detect the availability of libdar + + /// use AC_CHECK_LIB(dar, [for_autoconf], [], []) + /// to have autoconf based configure script properly detecting + /// the presence and usability of libthreadar + extern unsigned int for_autoconf(unsigned int x); +} + #endif