blob: d96e5afe378bf22240f5c139ae391c8458e478bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
https://github.com/toddr/IO-Tty/pull/33
From fae771aefc593a0ef798bc0c1e21b0524eb85e2d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 31 Aug 2022 20:32:35 -0700
Subject: [PATCH] Tty.xs: Do not mark strlcpy as static
Some libcs e.g. musl do not provide implementation of strlcpy but they
do provide the signature in string.h, if we mark it static here then it
conflicts with the libc define and compiler may warn/error
Fixes
Tty.xs:190:1: error: static declaration of 'strlcpy' follows non-static declaration
strlcpy( ^
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libio-pty-perl/1.16-r0/recipe-sysroot/usr/include/string.h:86:8: note: previous declaration is here
size_t strlcpy (char *, const char *, size_t); ^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/Tty.xs
+++ b/Tty.xs
@@ -186,11 +186,11 @@ mysignal(int sig, mysig_t act)
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
-static size_t
-strlcpy(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
+size_t
+strlcpy(
+ char *dst,
+ const char *src,
+ size_t siz)
{
register char *d = dst;
register const char *s = src;
|