diff options
| author | mrg <mrg@NetBSD.org> | 1998-03-29 08:31:49 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 1998-03-29 08:31:49 +0000 |
| commit | 1d9ec375c03e61d8a3d986cfa9e47e8060cf509a (patch) | |
| tree | d4e3449c96a7263e1e9e519c8f19a3d1cb3ea411 /gnu/dist/libstdc++/cstring | |
| parent | d3c5e32f1d27a9891610753a12932ae435e29ce6 (diff) | |
initial import of the egcs 1.0.2 standard c++ library
Diffstat (limited to 'gnu/dist/libstdc++/cstring')
| -rw-r--r-- | gnu/dist/libstdc++/cstring | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/gnu/dist/libstdc++/cstring b/gnu/dist/libstdc++/cstring new file mode 100644 index 00000000000..d8d03a765b6 --- /dev/null +++ b/gnu/dist/libstdc++/cstring @@ -0,0 +1,96 @@ +// The -*- C++ -*- null-terminated string header. +// This file is part of the GNU ANSI C++ Library. + +#ifndef __CSTRING__ +#define __CSTRING__ + +#include <string.h> + +#if 0 // Let's not bother with this just yet. +#include <cstddef> + +#ifdef __GNUG__ +#pragma interface "cstring" +#endif + +// The ANSI C prototypes for these functions have a const argument type and +// non-const return type, so we can't use them. + +extern "C++" { +extern inline const char * +_G_strchr (const char *s, int c) +{ + return strchr (s, c); +} + +extern inline char * +_G_strchr (char *s, int c) +{ + return const_cast<char *> (strchr (s, c)); +} + +extern inline const char * +_G_strpbrk (const char *s1, const char *s2) +{ + return strpbrk (s1, s2); +} + +extern inline char * +_G_strpbrk (char *s1, const char *s2) +{ + return const_cast<char *> (strpbrk (s1, s2)); +} + +extern inline const char * +_G_strrchr (const char *s, int c) +{ + return strrchr (s, c); +} + +extern inline char * +_G_strrchr (char *s, int c) +{ + return const_cast<char *> (strrchr (s, c)); +} + +extern inline const char * +_G_strstr (const char *s1, const char *s2) +{ + return strstr (s1, s2); +} + +extern inline char * +_G_strstr (char *s1, const char *s2) +{ + return const_cast<char *> (strstr (s1, s2)); +} + +extern inline const void * +_G_memchr (const void *s, int c, size_t n) +{ + return memchr (s, c, n); +} + +extern inline void * +_G_memchr (void *s, int c, size_t n) +{ + return const_cast<void *> (memchr (s, c, n)); +} +} // extern "C++" + +// Lose any vendor macros for these functions. +#undef strchr +#undef strpbrk +#undef strrchr +#undef strstr +#undef memchr + +// Ewww, namespace pollution. Anyone have a better idea? +#define strchr _G_strchr +#define strpbrk _G_strpbrk +#define strrchr _G_strrchr +#define strstr _G_strstr +#define memchr _G_memchr +#endif // 0 + +#endif // !defined (__CSTRING__) |
