Hi,

Thank you!!!

I've made a small change to the patch: used -D_DEFAULT_SOURCE[1] to
avoid the deprecation warning. I have tested noble and sid build with
the attached patch.

Best Regards,
 Vladimir.
[1] https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html

On Mon, Mar 25, 2024 at 9:57 PM Sebastiaan Couwenberg
<[email protected]> wrote:
>
> On 3/25/24 9:25 AM, Vladimir Petko wrote:
> >   strlcpy and strlcat were introduced in glibc 2.38[1]. At the moment
> > Ubuntu noble has 2.39  and Debian unstable  - 2.37.
>
> Can you try the attached patch which patches CMakeLists.txt to add the
> definition when strlcat/strlcpy are found on Linux?
>
> Kind Regards,
>
> Bas
>
> --
>   GPG Key ID: 4096R/6750F10AE88D4AF1
> Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
Description: Add -D_BSD_SOURCE for strlcat/strlcpy privided by glibc >= 2.38.
Author: Bas Couwenberg <[email protected]>
Bug-Debian: https://bugs.debian.org/1067651

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,6 +121,10 @@ check_function_exists("strlcpy"  HAVE_ST
 check_function_exists("strlen"  HAVE_STRLEN)
 check_function_exists("strncasecmp"  HAVE_STRNCASECMP)

+IF((HAVE_STRLCAT OR HAVE_STRLCPY) AND CMAKE_SYSTEM_NAME MATCHES "Linux")
+    add_definitions(-D_DEFAULT_SOURCE)
+ENDIF()
+
 check_symbol_exists(vsnprintf stdio.h HAVE_VSNPRINTF)
 IF(NOT HAVE_VSNPRINTF)
     check_function_exists("vsnprintf"  HAVE_VSNPRINTF)
_______________________________________________
Pkg-grass-devel mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to