Commit Graph

13 Commits

Author SHA1 Message Date
Corinna Vinschen ad101bcb0f Rename <xlocale.h> back to <sys/_locale.h>
libX11 provides <X11/Xlocale.h>.  The build of libX11 itself adds
include/X11 to the compiler's include path.  This results in a name
collision with /usr/include/xlocale.h on case-insensitive filesystems.

Commit 90e35b1eb3 renamed sys/_locale.h to xlocale.h in March 2017 under
the assumption that we should provide the locale_t type in the same file
as on Linux, FreeBSD, and Darwin.

A few weeks later (June 2017), glibc removed the xlocale.h file in favor
of bits/types/locale_t.h, which shouldn't be included directly anyway.

For reference and the reasoning, see
https://sourceware.org/git/?p=glibc.git;a=commit;h=f0be25b6336d

Given the above, revert 90e35b1eb3 and
fix additional usage of xlocale.h.
2019-06-14 10:02:08 +02:00
Yaakov Selkowitz a997f98b2a ssp: add Object Size Checking for strings.h
The implementation is from NetBSD, with the addition of explicit_bzero
for parity with glibc.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-11-29 11:25:41 -06:00
Sebastian Huber 1f42dc2bcf Make ffsl() and ffsll() BSD-visible
Since glibc 2.27, they are visible via _DEFAULT_SOURCE (__USE_MISC):

https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man3/ffs.3?id=247bbcf00c9a425ab0ad6e303ec8718e4ba844a6

In FreeBSD, they are guarded by __BSD_VISIBLE.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-11-03 10:46:07 +01:00
Yaakov Selkowitz 51d1fb715d include: fix ffs, fls guards
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-08-30 12:29:47 -05:00
Sebastian Huber 2390e71a42 Synchronize <strings.h> with latest FreeBSD
Include <strings.h> in <string.h> if __BSD_VISIBLE like on FreeBSD.
Remove redundant declarations from <string.h>.  Make ffsl(), ffsll(),
strncasecmp(), strcasecmp_l(), and strncasecmp_l() visible via
__BSD_VISIBLE instead of __GNU_VISIBLE.  Add fls(), flsl(), and flsll()
to <strings.h> if __BSD_VISIBLE.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-07-05 13:49:48 +02:00
Yaakov Selkowitz 90e35b1eb3 Rename <sys/_locale.h> to <xlocale.h>
The locale_t type is provided by <xlocale.h> on Linux, FreeBSD, and Darwin.
While, like on some of those systems, it is automatically included by
<locale.h> with the proper feature test macros, its presence under this
particular name is still presumed in real-world software.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-03-22 10:03:45 +01:00
Brian Inglis 448b46397d Add strerror_l prototype, change str[n]casecmp_l feature tests
strerror_l prototype was missing.
str[n]casecmp_l feature tests in string.h vs. strings.h were transposed.
2016-08-25 09:44:31 +02:00
Corinna Vinschen 80e0ad1e77 Add missing declarations of str{n}casecmp_l to strings.h.
Per glibc, both funcs are defined as GNU visible in strings.h.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23 17:40:03 +02:00
Yaakov Selkowitz 9f90ae0435 Feature test macros overhaul: string.h and strings.h overlaps
strings.h is the header mandated for these functions in POSIX.1 prior to
2008 (when most of these were removed).  The declarations in string.h are
only for BSD compatibility.  But when both headers are included, avoid
duplicate declarations.

Also, mark stpcpy and stpncpy as POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-13 23:50:11 -05:00
Yaakov Selkowitz 6fe6a822ee Feature test macros overhaul: strings.h
Replace __STRICT_ANSI__ with the proper internal macros for bcmp etc.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:09 -05:00
Corinna Vinschen a406e79b02 * libc/include/strings.h: Don't include locale.h. 2010-12-08 10:28:40 +00:00
Eric Blake 1dfc6c9535 strings.h: avoid namespace pollution
* libc/include/strings.h: Don't declare removed functions when
requesting POSIX 2008 compliance.
2010-12-08 02:47:14 +00:00
Jeff Johnston 1d1dde068c 2010-12-07 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/include/strings.h: New (split-out from string.h).
2010-12-07 17:31:26 +00:00