summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-09-12 16:23:15 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-09-12 16:23:15 +0000
commite62064ff42624273a7cb491d6fad8ea75cc49ec5 (patch)
tree473d151ed967b36c822bb6651d2e38a2be7f771c /lib/libc/string
parentba0532728244adb43ac9a8736e12d78e685ed88d (diff)
Wrap <inttypes.h> and finish wrapping of <wchar.h> so that calls go direct
and the symbols not in the C standard are weak
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/wcscasecmp.c4
-rw-r--r--lib/libc/string/wcscat.c3
-rw-r--r--lib/libc/string/wcschr.c3
-rw-r--r--lib/libc/string/wcscmp.c3
-rw-r--r--lib/libc/string/wcscspn.c3
-rw-r--r--lib/libc/string/wcsdup.c3
-rw-r--r--lib/libc/string/wcslcat.c3
-rw-r--r--lib/libc/string/wcslcpy.c3
-rw-r--r--lib/libc/string/wcslen.c3
-rw-r--r--lib/libc/string/wcsncat.c3
-rw-r--r--lib/libc/string/wcsncmp.c3
-rw-r--r--lib/libc/string/wcsncpy.c3
-rw-r--r--lib/libc/string/wcspbrk.c3
-rw-r--r--lib/libc/string/wcsrchr.c3
-rw-r--r--lib/libc/string/wcsspn.c3
-rw-r--r--lib/libc/string/wcsstr.c5
-rw-r--r--lib/libc/string/wcswidth.c3
-rw-r--r--lib/libc/string/wmemchr.c3
-rw-r--r--lib/libc/string/wmemcmp.c3
-rw-r--r--lib/libc/string/wmemcpy.c3
-rw-r--r--lib/libc/string/wmemmove.c3
-rw-r--r--lib/libc/string/wmemset.c3
22 files changed, 47 insertions, 22 deletions
diff --git a/lib/libc/string/wcscasecmp.c b/lib/libc/string/wcscasecmp.c
index b14997ee751..b122e720fee 100644
--- a/lib/libc/string/wcscasecmp.c
+++ b/lib/libc/string/wcscasecmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcscasecmp.c,v 1.2 2011/06/01 19:29:48 naddy Exp $ */
+/* $OpenBSD: wcscasecmp.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*
* Copyright (c) 2011 Marc Espie
@@ -41,6 +41,7 @@ wcscasecmp(const wchar_t *s1, const wchar_t *s2)
/* XXX assumes wchar_t = int */
return ((rune_t)l1 - (rune_t)l2);
}
+DEF_WEAK(wcscasecmp);
int
wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
@@ -59,3 +60,4 @@ wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
} while (--n != 0);
return (0);
}
+DEF_WEAK(wcsncasecmp);
diff --git a/lib/libc/string/wcscat.c b/lib/libc/string/wcscat.c
index a4841a975af..5ddb510fad2 100644
--- a/lib/libc/string/wcscat.c
+++ b/lib/libc/string/wcscat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcscat.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcscat.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcscat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
@@ -53,3 +53,4 @@ wcscat(wchar_t *s1, const wchar_t *s2)
*q = '\0';
return s1;
}
+DEF_STRONG(wcscat);
diff --git a/lib/libc/string/wcschr.c b/lib/libc/string/wcschr.c
index b84a2d32e3a..231c7605a29 100644
--- a/lib/libc/string/wcschr.c
+++ b/lib/libc/string/wcschr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcschr.c,v 1.4 2008/08/23 05:34:36 djm Exp $ */
+/* $OpenBSD: wcschr.c,v 1.5 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
@@ -48,3 +48,4 @@ wcschr(const wchar_t *s, wchar_t c)
}
/* NOTREACHED */
}
+DEF_STRONG(wcschr);
diff --git a/lib/libc/string/wcscmp.c b/lib/libc/string/wcscmp.c
index 4a8f6ba3fb9..42d6bca3ccb 100644
--- a/lib/libc/string/wcscmp.c
+++ b/lib/libc/string/wcscmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcscmp.c,v 1.4 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcscmp.c,v 1.5 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */
/*-
@@ -49,3 +49,4 @@ wcscmp(const wchar_t *s1, const wchar_t *s2)
/* XXX assumes wchar_t = int */
return (*(const rune_t *)s1 - *(const rune_t *)--s2);
}
+DEF_STRONG(wcscmp);
diff --git a/lib/libc/string/wcscspn.c b/lib/libc/string/wcscspn.c
index cf40092465e..23e78ab22fc 100644
--- a/lib/libc/string/wcscspn.c
+++ b/lib/libc/string/wcscspn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcscspn.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcscspn.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
@@ -51,3 +51,4 @@ wcscspn(const wchar_t *s, const wchar_t *set)
done:
return (p - s);
}
+DEF_STRONG(wcscspn);
diff --git a/lib/libc/string/wcsdup.c b/lib/libc/string/wcsdup.c
index 085d1c445d9..36f19186ab7 100644
--- a/lib/libc/string/wcsdup.c
+++ b/lib/libc/string/wcsdup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsdup.c,v 1.2 2014/10/08 05:27:17 deraadt Exp $ */
+/* $OpenBSD: wcsdup.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcsdup.c,v 1.3 2008/05/26 13:17:48 haad Exp $ */
/*
@@ -29,3 +29,4 @@ wcsdup(const wchar_t *str)
return (wmemcpy(copy, str, len));
}
+DEF_WEAK(wcsdup);
diff --git a/lib/libc/string/wcslcat.c b/lib/libc/string/wcslcat.c
index 2dfe2aae317..aa581466256 100644
--- a/lib/libc/string/wcslcat.c
+++ b/lib/libc/string/wcslcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcslcat.c,v 1.5 2015/01/15 03:54:12 millert Exp $ */
+/* $OpenBSD: wcslcat.c,v 1.6 2015/09/12 16:23:14 guenther Exp $ */
/*
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -53,3 +53,4 @@ wcslcat(wchar_t *dst, const wchar_t *src, size_t dsize)
return(dlen + (src - osrc)); /* count does not include NUL */
}
+DEF_WEAK(wcslcat);
diff --git a/lib/libc/string/wcslcpy.c b/lib/libc/string/wcslcpy.c
index 1c4811577fa..36a544a33c4 100644
--- a/lib/libc/string/wcslcpy.c
+++ b/lib/libc/string/wcslcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcslcpy.c,v 1.6 2015/01/15 03:54:12 millert Exp $ */
+/* $OpenBSD: wcslcpy.c,v 1.7 2015/09/12 16:23:14 guenther Exp $ */
/*
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -48,3 +48,4 @@ wcslcpy(wchar_t *dst, const wchar_t *src, size_t dsize)
return(src - osrc - 1); /* count does not include NUL */
}
+DEF_WEAK(wcslcpy);
diff --git a/lib/libc/string/wcslen.c b/lib/libc/string/wcslen.c
index c1de4a271e4..16d4bba1285 100644
--- a/lib/libc/string/wcslen.c
+++ b/lib/libc/string/wcslen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcslen.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcslen.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcslen.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
@@ -42,3 +42,4 @@ wcslen(const wchar_t *s)
return p - s;
}
+DEF_STRONG(wcslen);
diff --git a/lib/libc/string/wcsncat.c b/lib/libc/string/wcsncat.c
index eb9a701514a..2b4b9f0d491 100644
--- a/lib/libc/string/wcsncat.c
+++ b/lib/libc/string/wcsncat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsncat.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcsncat.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcsncat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*-
@@ -50,3 +50,4 @@ wcsncat(wchar_t *s1, const wchar_t *s2, size_t n)
*q = '\0';
return s1;
}
+DEF_STRONG(wcsncat);
diff --git a/lib/libc/string/wcsncmp.c b/lib/libc/string/wcsncmp.c
index fb3c7057cf9..bdaab33e4cb 100644
--- a/lib/libc/string/wcsncmp.c
+++ b/lib/libc/string/wcsncmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsncmp.c,v 1.4 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcsncmp.c,v 1.5 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */
/*
@@ -50,3 +50,4 @@ wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n)
} while (--n != 0);
return (0);
}
+DEF_STRONG(wcsncmp);
diff --git a/lib/libc/string/wcsncpy.c b/lib/libc/string/wcsncpy.c
index 107696f1de4..1be482b1140 100644
--- a/lib/libc/string/wcsncpy.c
+++ b/lib/libc/string/wcsncpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsncpy.c,v 1.4 2006/04/17 18:05:35 espie Exp $ */
+/* $OpenBSD: wcsncpy.c,v 1.5 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcsncpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -48,3 +48,4 @@ wcsncpy(wchar_t *s1, const wchar_t *s2, size_t n)
return s1;
}
+DEF_STRONG(wcsncpy);
diff --git a/lib/libc/string/wcspbrk.c b/lib/libc/string/wcspbrk.c
index 1923abfc89b..2178dc40673 100644
--- a/lib/libc/string/wcspbrk.c
+++ b/lib/libc/string/wcspbrk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcspbrk.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcspbrk.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcspbrk.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -51,3 +51,4 @@ wcspbrk(const wchar_t *s, const wchar_t *set)
}
return NULL;
}
+DEF_STRONG(wcspbrk);
diff --git a/lib/libc/string/wcsrchr.c b/lib/libc/string/wcsrchr.c
index 3433310c56f..b69bdac1c92 100644
--- a/lib/libc/string/wcsrchr.c
+++ b/lib/libc/string/wcsrchr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsrchr.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcsrchr.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcsrchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -48,3 +48,4 @@ wcsrchr(const wchar_t *s, wchar_t c)
}
return NULL;
}
+DEF_STRONG(wcsrchr);
diff --git a/lib/libc/string/wcsspn.c b/lib/libc/string/wcsspn.c
index 5162fa07631..a3f28e3a49b 100644
--- a/lib/libc/string/wcsspn.c
+++ b/lib/libc/string/wcsspn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsspn.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcsspn.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcsspn.c,v 1.3 2001/09/21 16:09:15 yamt Exp $ */
/*-
@@ -53,3 +53,4 @@ wcsspn(const wchar_t *s, const wchar_t *set)
done:
return (p - s);
}
+DEF_STRONG(wcsspn);
diff --git a/lib/libc/string/wcsstr.c b/lib/libc/string/wcsstr.c
index 669e3402808..6a08b625515 100644
--- a/lib/libc/string/wcsstr.c
+++ b/lib/libc/string/wcsstr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcsstr.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wcsstr.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcsstr.c,v 1.3 2003/03/05 20:18:17 tshiozak Exp $ */
/*-
@@ -68,3 +68,6 @@ wcsstr(const wchar_t *big, const wchar_t *little)
}
return NULL;
}
+#ifndef WCSWCS
+DEF_STRONG(wcsstr);
+#endif
diff --git a/lib/libc/string/wcswidth.c b/lib/libc/string/wcswidth.c
index 8ea1bdf6e66..9f003f96c74 100644
--- a/lib/libc/string/wcswidth.c
+++ b/lib/libc/string/wcswidth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcswidth.c,v 1.4 2011/04/04 18:16:24 stsp Exp $ */
+/* $OpenBSD: wcswidth.c,v 1.5 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -48,3 +48,4 @@ wcswidth(const wchar_t *s, size_t n)
return w;
}
+DEF_WEAK(wcswidth);
diff --git a/lib/libc/string/wmemchr.c b/lib/libc/string/wmemchr.c
index 8c9517861b3..55fb76a5e69 100644
--- a/lib/libc/string/wmemchr.c
+++ b/lib/libc/string/wmemchr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wmemchr.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wmemchr.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wmemchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -45,3 +45,4 @@ wmemchr(const wchar_t *s, wchar_t c, size_t n)
}
return NULL;
}
+DEF_STRONG(wmemchr);
diff --git a/lib/libc/string/wmemcmp.c b/lib/libc/string/wmemcmp.c
index 39419aeddc4..46617e29cf4 100644
--- a/lib/libc/string/wmemcmp.c
+++ b/lib/libc/string/wmemcmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wmemcmp.c,v 1.4 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wmemcmp.c,v 1.5 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $ */
/*-
@@ -48,3 +48,4 @@ wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n)
}
return 0;
}
+DEF_STRONG(wmemcmp);
diff --git a/lib/libc/string/wmemcpy.c b/lib/libc/string/wmemcpy.c
index 9bbd83648e7..cf02ab9d566 100644
--- a/lib/libc/string/wmemcpy.c
+++ b/lib/libc/string/wmemcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wmemcpy.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wmemcpy.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -38,3 +38,4 @@ wmemcpy(wchar_t *d, const wchar_t *s, size_t n)
return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t));
}
+DEF_STRONG(wmemcpy);
diff --git a/lib/libc/string/wmemmove.c b/lib/libc/string/wmemmove.c
index 21bbabcd0cd..8bf8011064f 100644
--- a/lib/libc/string/wmemmove.c
+++ b/lib/libc/string/wmemmove.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wmemmove.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wmemmove.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wmemmove.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -38,3 +38,4 @@ wmemmove(wchar_t *d, const wchar_t *s, size_t n)
return (wchar_t *)memmove(d, s, n * sizeof(wchar_t));
}
+DEF_STRONG(wmemmove);
diff --git a/lib/libc/string/wmemset.c b/lib/libc/string/wmemset.c
index ac476dba6ad..a2d3295170e 100644
--- a/lib/libc/string/wmemset.c
+++ b/lib/libc/string/wmemset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wmemset.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: wmemset.c,v 1.4 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wmemset.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*-
@@ -44,3 +44,4 @@ wmemset(wchar_t *s, wchar_t c, size_t n)
}
return s;
}
+DEF_STRONG(wmemset);