build: Conditionalize wcslcpy() and wcslcat() functions on macOS

These functions are provided by the system libc.
This commit is contained in:
Guillem Jover
2023-04-23 02:05:04 +02:00
parent dc1bd1a2cb
commit 5434ba169b
4 changed files with 19 additions and 4 deletions

View 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"])

View File

@@ -50,8 +50,10 @@
__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

View 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 \

View 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 \