]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
build: Conditionalize wcslcpy() and wcslcat() functions on macOS
authorGuillem Jover <guillem@hadrons.org>
Sun, 23 Apr 2023 00:05:04 +0000 (02:05 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sat, 29 Apr 2023 01:52:49 +0000 (03:52 +0200)
These functions are provided by the system libc.

configure.ac
include/bsd/wchar.h
man/Makefile.am
src/Makefile.am

index 9b2c27777fb4d1b811abda3afc433c01482f2a83..aabe28e5b769ba5832512d02ea30ea2e990f9a20 100644 (file)
@@ -324,6 +324,7 @@ need_progname=yes
 need_md5=yes
 need_nlist=yes
 need_strl=yes
+need_wcsl=yes
 need_strmode=yes
 need_id_from_name=yes
 need_fpurge=yes
@@ -354,6 +355,7 @@ AS_CASE([$host_os],
     need_md5=no
     need_nlist=no
     need_strl=no
+    need_wcsl=no
     need_strmode=no
     need_id_from_name=no
     need_fpurge=no
@@ -371,6 +373,7 @@ AM_CONDITIONAL([NEED_TRANSPARENT_LIBMD], [test "x$need_transparent_libmd" = "xye
 AM_CONDITIONAL([NEED_MD5], [test "x$need_md5" = "xyes"])
 AM_CONDITIONAL([NEED_NLIST], [test "x$need_nlist" = "xyes"])
 AM_CONDITIONAL([NEED_STRL], [test "x$need_strl" = "xyes"])
+AM_CONDITIONAL([NEED_WCSL], [test "x$need_wcsl" = "xyes"])
 AM_CONDITIONAL([NEED_STRMODE], [test "x$need_strmode" = "xyes"])
 AM_CONDITIONAL([NEED_ID_FROM_NAME], [test "x$need_id_from_name" = "xyes"])
 AM_CONDITIONAL([NEED_FPURGE], [test "x$need_fpurge" = "xyes"])
index 7216503f474d628db66404cd1edcfe8c5dc1576e..8edef2330048a5f463e424f9d66b8e076e926918 100644 (file)
 __BEGIN_DECLS
 wchar_t *fgetwln(FILE *stream, size_t *len);
 
+#if !defined(__APPLE__)
 size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
 size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
+#endif
 __END_DECLS
 
 #endif
index 118ab2daae14e0632b23c2eeb756d3494301021e..b89c3ddb730e0e1baadb65dde48b0d8f30bf9b5d 100644 (file)
@@ -238,8 +238,6 @@ dist_man_MANS = \
        unvis.3bsd \
        user_from_uid.3bsd \
        vis.3bsd \
-       wcslcat.3bsd \
-       wcslcpy.3bsd \
        # EOL
 
 if NEED_PROGNAME
@@ -268,6 +266,13 @@ dist_man_MANS += \
        # EOL
 endif
 
+if NEED_WCSL
+dist_man_MANS += \
+       wcslcat.3bsd \
+       wcslcpy.3bsd \
+       # EOL
+endif
+
 if NEED_STRMODE
 dist_man_MANS += \
        strmode.3bsd \
index 0648b03a972e1f06bd81433ee7aa84a32254fda2..fd4bee9e217106dac349c5d84cc67e8db9ede837 100644 (file)
@@ -112,8 +112,6 @@ libbsd_la_SOURCES = \
        timeconv.c \
        unvis.c \
        vis.c \
-       wcslcat.c \
-       wcslcpy.c \
        # EOL
 
 if NEED_BSD_GETOPT
@@ -158,6 +156,13 @@ libbsd_la_SOURCES += \
        # EOL
 endif
 
+if NEED_WCSL
+libbsd_la_SOURCES += \
+       wcslcat.c \
+       wcslcpy.c \
+       # EOL
+endif
+
 if NEED_STRMODE
 libbsd_la_SOURCES += \
        strmode.c \