summaryrefslogtreecommitdiffstats
path: root/contrib/libg++/libstdc++/std/cstring.h
blob: 6d493e7501e548fe7807573a10b9e05fdad37f3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// The -*- C++ -*- null-terminated string header.
// This file is part of the GNU ANSI C++ Library.

#ifndef __CSTRING__
#define __CSTRING__

#if 0 // Let's not bother with this just yet.
// The ANSI C prototypes for these functions have a const argument type and
// non-const return type, so we can't use them.

#define strchr  __hide_strchr
#define strpbrk __hide_strpbrk
#define strrchr __hide_strrchr
#define strstr  __hide_strstr
#define memchr  __hide_memchr
#endif // 0

#include_next <string.h>

#if 0 // Let's not bother with this just yet.
#undef strchr
#undef strpbrk
#undef strrchr
#undef strstr
#undef memchr

#include <std/cstddef.h>

#ifdef __GNUG__
#pragma interface "std/cstring.h"
#endif

extern "C++" {
extern "C" const char *strchr (const char *, int);
inline char *
strchr (char *s, int c)
{
  return const_cast<char *> (strchr (static_cast<const char *> (s), c));
}

extern "C" const char *strpbrk (const char *, const char *);
inline char *
strpbrk (char *s1, const char *s2)
{
  return const_cast<char *> (strpbrk (static_cast<const char *> (s1), s2));
}

extern "C" const char *strrchr (const char *, int);
inline char *
strrchr (char *s, int c)
{
  return const_cast<char *> (strrchr (static_cast<const char *> (s), c));
}

extern "C" const char *strstr (const char *, const char *);
inline char *
strstr (char *s1, const char *s2)
{
  return const_cast<char *> (strstr (static_cast<const char *> (s1), s2));
}

extern "C" const void *memchr (const void *, int, size_t);
inline void *
memchr (void *s, int c, size_t n)
{
  return const_cast<void *> (memchr (static_cast<const void *> (s), c, n));
}
} // extern "C++"

#endif // 0
#endif // !defined (__CSTRING__)
OpenPOWER on IntegriCloud