]> sourceware.org Git - newlib-cygwin.git/commit
Rework handling of basename variants
authorYaakov Selkowitz <yselkowi@redhat.com>
Mon, 6 Jul 2015 19:58:51 +0000 (14:58 -0500)
committerYaakov Selkowitz <yselkowi@redhat.com>
Mon, 6 Jul 2015 19:58:51 +0000 (14:58 -0500)
commit79e419de6261c4e04785908828096cb4d56b8680
tree72f17165f0acb9ad42eb45c801acfd7624570c5c
parentf9b87aaf109366342777521fe93fe9f795e8f1fa
Rework handling of basename variants

As a commonly-included header, the #define basename in <string.h> can
affect code which uses "basename" for its own purposes (e.g. struct
members or C++ namespaced functions).  When such cases occur and some
code includes <string.h> and some not, then errors result.  OTOH,
<libgen.h> is rarely used, and that's where the renaming occurs in
glibc, so code using <libgen.h> should already be safe.

* libc/include/libgen.h (basename): Define as __xpg_basename
for source compatibility with glibc.
Declare with __ASMNAME("basename") for ABI compatibility.
* libc/include/string.h (basename): Define as basename for
source compatibility with glibc.
Declare with __ASMNAME("__gnu_basename") for ABI compatibility.
newlib/ChangeLog
newlib/libc/include/libgen.h
newlib/libc/include/string.h
This page took 0.030477 seconds and 5 git commands to generate.