summaryrefslogtreecommitdiff
path: root/lib
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
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')
-rw-r--r--lib/libc/hidden/inttypes.h30
-rw-r--r--lib/libc/hidden/wchar.h98
-rw-r--r--lib/libc/locale/_wcstod.h3
-rw-r--r--lib/libc/locale/_wcstol.h3
-rw-r--r--lib/libc/locale/_wcstoul.h3
-rw-r--r--lib/libc/locale/btowc.c3
-rw-r--r--lib/libc/locale/iswctype.c3
-rw-r--r--lib/libc/locale/mbrlen.c3
-rw-r--r--lib/libc/locale/multibyte_citrus.c9
-rw-r--r--lib/libc/locale/wctob.c3
-rw-r--r--lib/libc/stdio/open_wmemstream.c3
-rw-r--r--lib/libc/stdlib/strtoimax.c3
-rw-r--r--lib/libc/stdlib/strtoumax.c3
-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
35 files changed, 153 insertions, 83 deletions
diff --git a/lib/libc/hidden/inttypes.h b/lib/libc/hidden/inttypes.h
new file mode 100644
index 00000000000..25427145fe5
--- /dev/null
+++ b/lib/libc/hidden/inttypes.h
@@ -0,0 +1,30 @@
+/* $OpenBSD: inttypes.h,v 1.1 2015/09/12 16:23:14 guenther Exp $ */
+/*
+ * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBC_INTTYPES_H_
+#define _LIBC_INTTYPES_H_
+
+#include_next <inttypes.h>
+
+PROTO_STD_DEPRECATED(imaxabs);
+PROTO_STD_DEPRECATED(imaxdiv);
+PROTO_NORMAL(strtoimax);
+PROTO_NORMAL(strtoumax);
+PROTO_NORMAL(wcstoimax);
+PROTO_NORMAL(wcstoumax);
+
+#endif /* _LIBC_INTTYPES_H_ */
diff --git a/lib/libc/hidden/wchar.h b/lib/libc/hidden/wchar.h
index 290eec61c48..36b02094790 100644
--- a/lib/libc/hidden/wchar.h
+++ b/lib/libc/hidden/wchar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wchar.h,v 1.2 2015/09/10 18:13:46 guenther Exp $ */
+/* $OpenBSD: wchar.h,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
@@ -20,7 +20,7 @@
#include_next <wchar.h>
-/*PROTO_NORMAL(btowc);*/
+PROTO_NORMAL(btowc);
PROTO_NORMAL(fgetwc);
PROTO_NORMAL(fgetws);
PROTO_NORMAL(fputwc);
@@ -30,12 +30,12 @@ PROTO_NORMAL(fwprintf);
PROTO_NORMAL(fwscanf);
PROTO_NORMAL(getwc);
PROTO_NORMAL(getwchar);
-/*PROTO_NORMAL(mbrlen);*/
-/*PROTO_NORMAL(mbrtowc);*/
-/*PROTO_NORMAL(mbsinit);*/
-/*PROTO_NORMAL(mbsnrtowcs);*/
-/*PROTO_NORMAL(mbsrtowcs);*/
-PROTO_NORMAL(open_wmemstream);
+PROTO_NORMAL(mbrlen);
+PROTO_NORMAL(mbrtowc);
+PROTO_NORMAL(mbsinit);
+PROTO_NORMAL(mbsnrtowcs);
+PROTO_NORMAL(mbsrtowcs);
+PROTO_DEPRECATED(open_wmemstream);
PROTO_NORMAL(putwc);
PROTO_NORMAL(putwchar);
PROTO_NORMAL(swprintf);
@@ -47,47 +47,47 @@ PROTO_NORMAL(vswprintf);
PROTO_NORMAL(vswscanf);
PROTO_NORMAL(vwprintf);
PROTO_NORMAL(vwscanf);
-/*PROTO_NORMAL(wcrtomb);*/
-/*PROTO_NORMAL(wcscasecmp);*/
-/*PROTO_NORMAL(wcscat);*/
-/*PROTO_NORMAL(wcschr);*/
-/*PROTO_NORMAL(wcscmp);*/
-/*PROTO_NORMAL(wcscoll);*/
-/*PROTO_NORMAL(wcscpy);*/
-/*PROTO_NORMAL(wcscspn);*/
-/*PROTO_NORMAL(wcsdup);*/
-/*PROTO_NORMAL(wcsftime);*/
-/*PROTO_NORMAL(wcslcat);*/
-/*PROTO_NORMAL(wcslcpy);*/
-/*PROTO_NORMAL(wcslen);*/
-/*PROTO_NORMAL(wcsncasecmp);*/
-/*PROTO_NORMAL(wcsncat);*/
-/*PROTO_NORMAL(wcsncmp);*/
-/*PROTO_NORMAL(wcsncpy);*/
-/*PROTO_NORMAL(wcsnrtombs);*/
-/*PROTO_NORMAL(wcspbrk);*/
-/*PROTO_NORMAL(wcsrchr);*/
-/*PROTO_NORMAL(wcsrtombs);*/
-/*PROTO_NORMAL(wcsspn);*/
-/*PROTO_NORMAL(wcsstr);*/
-/*PROTO_NORMAL(wcstod);*/
-/*PROTO_NORMAL(wcstof);*/
-/*PROTO_NORMAL(wcstok);*/
-/*PROTO_NORMAL(wcstol);*/
-/*PROTO_NORMAL(wcstold);*/
-/*PROTO_NORMAL(wcstoll);*/
-/*PROTO_NORMAL(wcstoul);*/
-/*PROTO_NORMAL(wcstoull);*/
-/*PROTO_NORMAL(wcswcs);*/
-/*PROTO_NORMAL(wcswidth);*/
-/*PROTO_NORMAL(wcsxfrm);*/
-/*PROTO_NORMAL(wctob);*/
-/*PROTO_NORMAL(wcwidth);*/
-/*PROTO_NORMAL(wmemchr);*/
-/*PROTO_NORMAL(wmemcmp);*/
-/*PROTO_NORMAL(wmemcpy);*/
-/*PROTO_NORMAL(wmemmove);*/
-/*PROTO_NORMAL(wmemset);*/
+PROTO_NORMAL(wcrtomb);
+PROTO_NORMAL(wcscasecmp);
+PROTO_NORMAL(wcscat);
+PROTO_NORMAL(wcschr);
+PROTO_NORMAL(wcscmp);
+PROTO_STD_DEPRECATED(wcscoll);
+PROTO_STD_DEPRECATED(wcscpy);
+PROTO_NORMAL(wcscspn);
+PROTO_NORMAL(wcsdup);
+PROTO_STD_DEPRECATED(wcsftime);
+PROTO_NORMAL(wcslcat);
+PROTO_NORMAL(wcslcpy);
+PROTO_NORMAL(wcslen);
+PROTO_NORMAL(wcsncasecmp);
+PROTO_NORMAL(wcsncat);
+PROTO_NORMAL(wcsncmp);
+PROTO_NORMAL(wcsncpy);
+PROTO_NORMAL(wcsnrtombs);
+PROTO_NORMAL(wcspbrk);
+PROTO_NORMAL(wcsrchr);
+PROTO_NORMAL(wcsrtombs);
+PROTO_NORMAL(wcsspn);
+PROTO_NORMAL(wcsstr);
+PROTO_NORMAL(wcstod);
+PROTO_NORMAL(wcstof);
+PROTO_STD_DEPRECATED(wcstok);
+PROTO_NORMAL(wcstol);
+PROTO_NORMAL(wcstold);
+PROTO_NORMAL(wcstoll);
+PROTO_NORMAL(wcstoul);
+PROTO_NORMAL(wcstoull);
+PROTO_DEPRECATED(wcswcs);
+PROTO_NORMAL(wcswidth);
+PROTO_STD_DEPRECATED(wcsxfrm);
+PROTO_NORMAL(wctob);
+PROTO_NORMAL(wcwidth);
+PROTO_NORMAL(wmemchr);
+PROTO_NORMAL(wmemcmp);
+PROTO_NORMAL(wmemcpy);
+PROTO_NORMAL(wmemmove);
+PROTO_NORMAL(wmemset);
PROTO_NORMAL(wprintf);
PROTO_NORMAL(wscanf);
diff --git a/lib/libc/locale/_wcstod.h b/lib/libc/locale/_wcstod.h
index ae993ad675e..de9de77e086 100644
--- a/lib/libc/locale/_wcstod.h
+++ b/lib/libc/locale/_wcstod.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _wcstod.h,v 1.2 2013/06/02 15:22:20 matthew Exp $ */
+/* $OpenBSD: _wcstod.h,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: wcstod.c,v 1.4 2001/10/28 12:08:43 yamt Exp $ */
/*-
@@ -151,3 +151,4 @@ fail:
return 0;
}
+DEF_STRONG(FUNCNAME);
diff --git a/lib/libc/locale/_wcstol.h b/lib/libc/locale/_wcstol.h
index 7b49bbff27a..e105b0100ff 100644
--- a/lib/libc/locale/_wcstol.h
+++ b/lib/libc/locale/_wcstol.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _wcstol.h,v 1.1 2005/07/01 08:59:27 espie Exp $ */
+/* $OpenBSD: _wcstol.h,v 1.2 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: _wcstol.h,v 1.2 2003/08/07 16:43:03 agc Exp $ */
/*-
@@ -134,3 +134,4 @@ FUNCNAME(const wchar_t *nptr, wchar_t **endptr, int base)
*endptr = (wchar_t *)(any ? s - 1 : nptr);
return (acc);
}
+DEF_STRONG(FUNCNAME);
diff --git a/lib/libc/locale/_wcstoul.h b/lib/libc/locale/_wcstoul.h
index 736b38fbeab..c42442295d5 100644
--- a/lib/libc/locale/_wcstoul.h
+++ b/lib/libc/locale/_wcstoul.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _wcstoul.h,v 1.1 2005/07/01 08:59:27 espie Exp $ */
+/* $OpenBSD: _wcstoul.h,v 1.2 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: _wcstoul.h,v 1.2 2003/08/07 16:43:03 agc Exp $ */
/*
@@ -114,3 +114,4 @@ FUNCNAME(const wchar_t *nptr, wchar_t **endptr, int base)
*endptr = (wchar_t *)(any ? s - 1 : nptr);
return (acc);
}
+DEF_STRONG(FUNCNAME);
diff --git a/lib/libc/locale/btowc.c b/lib/libc/locale/btowc.c
index 96273401ea2..455b3468f22 100644
--- a/lib/libc/locale/btowc.c
+++ b/lib/libc/locale/btowc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: btowc.c,v 1.2 2012/12/05 23:20:00 deraadt Exp $ */
+/* $OpenBSD: btowc.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*-
* Copyright (c) 2002, 2003 Tim J. Robbins.
@@ -50,3 +50,4 @@ btowc(int c)
return (WEOF);
return (wc);
}
+DEF_STRONG(btowc);
diff --git a/lib/libc/locale/iswctype.c b/lib/libc/locale/iswctype.c
index 0a557aaac76..fb0cde26392 100644
--- a/lib/libc/locale/iswctype.c
+++ b/lib/libc/locale/iswctype.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iswctype.c,v 1.4 2014/03/16 18:38:30 guenther Exp $ */
+/* $OpenBSD: iswctype.c,v 1.5 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: iswctype.c,v 1.15 2005/02/09 21:35:46 kleink Exp $ */
/*
@@ -168,6 +168,7 @@ wcwidth(wchar_t c)
return (((unsigned)__runetype_w(c) & _CTYPE_SWM) >> _CTYPE_SWS);
return -1;
}
+DEF_WEAK(wcwidth);
wctrans_t
wctrans(const char *charclass)
diff --git a/lib/libc/locale/mbrlen.c b/lib/libc/locale/mbrlen.c
index 0f05bd0721e..52df61a3c88 100644
--- a/lib/libc/locale/mbrlen.c
+++ b/lib/libc/locale/mbrlen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbrlen.c,v 1.2 2012/12/05 23:20:00 deraadt Exp $ */
+/* $OpenBSD: mbrlen.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*-
* Copyright (c) 2002-2004 Tim J. Robbins.
@@ -37,3 +37,4 @@ mbrlen(const char * __restrict s, size_t n, mbstate_t * __restrict ps)
ps = &mbs;
return (mbrtowc(NULL, s, n, ps));
}
+DEF_STRONG(mbrlen);
diff --git a/lib/libc/locale/multibyte_citrus.c b/lib/libc/locale/multibyte_citrus.c
index 739c4a8be5f..5e30f5bbee9 100644
--- a/lib/libc/locale/multibyte_citrus.c
+++ b/lib/libc/locale/multibyte_citrus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: multibyte_citrus.c,v 1.5 2015/02/05 12:59:57 millert Exp $ */
+/* $OpenBSD: multibyte_citrus.c,v 1.6 2015/09/12 16:23:14 guenther Exp $ */
/* $NetBSD: multibyte_amd1.c,v 1.7 2009/01/11 02:46:28 christos Exp $ */
/*-
@@ -51,6 +51,7 @@ mbsinit(const mbstate_t *ps)
cc = rl->rl_citrus_ctype;
return (*cc->cc_ops->co_mbsinit)(ps);
}
+DEF_STRONG(mbsinit);
size_t
mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
@@ -63,6 +64,7 @@ mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
cc = _CurrentRuneLocale->rl_citrus_ctype;
return (*cc->cc_ops->co_mbrtowc)(pwc, s, n, _ps_to_private(ps));
}
+DEF_STRONG(mbrtowc);
size_t
mbsrtowcs(wchar_t *dst, const char **src, size_t len, mbstate_t *ps)
@@ -73,6 +75,7 @@ mbsrtowcs(wchar_t *dst, const char **src, size_t len, mbstate_t *ps)
ps = &mbs;
return (mbsnrtowcs(dst, src, SIZE_MAX, len, ps));
}
+DEF_STRONG(mbsrtowcs);
size_t
mbsnrtowcs(wchar_t *dst, const char **src, size_t nmc, size_t len,
@@ -87,6 +90,7 @@ mbsnrtowcs(wchar_t *dst, const char **src, size_t nmc, size_t len,
return (*cc->cc_ops->co_mbsnrtowcs)(dst, src, nmc, len,
_ps_to_private(ps));
}
+DEF_WEAK(mbsnrtowcs);
size_t
wcrtomb(char *s, wchar_t wc, mbstate_t *ps)
@@ -99,6 +103,7 @@ wcrtomb(char *s, wchar_t wc, mbstate_t *ps)
cc = _CurrentRuneLocale->rl_citrus_ctype;
return (*cc->cc_ops->co_wcrtomb)(s, wc, _ps_to_private(ps));
}
+DEF_STRONG(wcrtomb);
size_t
wcsrtombs(char *dst, const wchar_t **src, size_t len, mbstate_t *ps)
@@ -109,6 +114,7 @@ wcsrtombs(char *dst, const wchar_t **src, size_t len, mbstate_t *ps)
ps = &mbs;
return (wcsnrtombs(dst, src, SIZE_MAX, len, ps));
}
+DEF_STRONG(wcsrtombs);
size_t
wcsnrtombs(char *dst, const wchar_t **src, size_t nwc, size_t len,
@@ -123,3 +129,4 @@ wcsnrtombs(char *dst, const wchar_t **src, size_t nwc, size_t len,
return (*cc->cc_ops->co_wcsnrtombs)(dst, src, nwc, len,
_ps_to_private(ps));
}
+DEF_WEAK(wcsnrtombs);
diff --git a/lib/libc/locale/wctob.c b/lib/libc/locale/wctob.c
index ea1f40c58aa..51ac3552368 100644
--- a/lib/libc/locale/wctob.c
+++ b/lib/libc/locale/wctob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wctob.c,v 1.2 2012/12/05 23:20:00 deraadt Exp $ */
+/* $OpenBSD: wctob.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*-
* Copyright (c) 2002-2004 Tim J. Robbins.
* All rights reserved.
@@ -41,3 +41,4 @@ wctob(wint_t c)
return (EOF);
return ((unsigned char)*buf);
}
+DEF_STRONG(wctob);
diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c
index f714e9edf46..aceef35153c 100644
--- a/lib/libc/stdio/open_wmemstream.c
+++ b/lib/libc/stdio/open_wmemstream.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: open_wmemstream.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: open_wmemstream.c,v 1.8 2015/09/12 16:23:14 guenther Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -167,4 +167,3 @@ open_wmemstream(wchar_t **pbuf, size_t *psize)
return (fp);
}
-DEF_WEAK(open_wmemstream);
diff --git a/lib/libc/stdlib/strtoimax.c b/lib/libc/stdlib/strtoimax.c
index 2fc04e48506..52403a72134 100644
--- a/lib/libc/stdlib/strtoimax.c
+++ b/lib/libc/stdlib/strtoimax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtoimax.c,v 1.2 2014/09/13 20:10:12 schwarze Exp $ */
+/* $OpenBSD: strtoimax.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
@@ -148,3 +148,4 @@ strtoimax(const char *nptr, char **endptr, int base)
*endptr = (char *) (any ? s - 1 : nptr);
return (acc);
}
+DEF_STRONG(strtoimax);
diff --git a/lib/libc/stdlib/strtoumax.c b/lib/libc/stdlib/strtoumax.c
index c73f7e507ca..4c5e3349f11 100644
--- a/lib/libc/stdlib/strtoumax.c
+++ b/lib/libc/stdlib/strtoumax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtoumax.c,v 1.2 2014/09/13 20:10:12 schwarze Exp $ */
+/* $OpenBSD: strtoumax.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
@@ -106,3 +106,4 @@ strtoumax(const char *nptr, char **endptr, int base)
*endptr = (char *) (any ? s - 1 : nptr);
return (acc);
}
+DEF_STRONG(strtoumax);
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);