This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Rename 'strbuf' to 'cpp_strbuf' to avoid conflict with DYNIX/ptx system headers
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 26 Sep 2003 01:51:23 -0400
- Subject: Re: [patch] Rename 'strbuf' to 'cpp_strbuf' to avoid conflict with DYNIX/ptx system headers
As committed:
* cppcharset.c, cpphash.h: Rename 'struct strbuf' to
'struct _cpp_strbuf'.
Index: cppcharset.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppcharset.c,v
retrieving revision 1.11
diff -u -r1.11 cppcharset.c
--- cppcharset.c 13 Jul 2003 17:34:17 -0000 1.11
+++ cppcharset.c 26 Sep 2003 05:50:39 -0000
@@ -92,7 +92,9 @@
#endif
/* This structure is used for a resizable string buffer throughout. */
-struct strbuf
+/* Don't call it strbuf, as that conflicts with unistd.h on systems
+ such as DYNIX/ptx where unistd.h includes stropts.h. */
+struct _cpp_strbuf
{
uchar *text;
size_t asize;
@@ -451,7 +453,7 @@
static inline bool
conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *,
uchar **, size_t *),
- iconv_t cd, const uchar *from, size_t flen, struct strbuf *to)
+ iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to)
{
const uchar *inbuf;
uchar *outbuf;
@@ -492,7 +494,7 @@
/* These functions convert entire strings between character sets.
They all have the signature
- bool (*)(iconv_t cd, const uchar *from, size_t flen, struct strbuf *to);
+ bool (*)(iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to);
The input string FROM is converted as specified by the function
name plus the iconv descriptor CD (which may be fake), and the
@@ -501,28 +503,28 @@
/* These four use the custom conversion code above. */
static bool
convert_utf8_utf16 (iconv_t cd, const uchar *from, size_t flen,
- struct strbuf *to)
+ struct _cpp_strbuf *to)
{
return conversion_loop (one_utf8_to_utf16, cd, from, flen, to);
}
static bool
convert_utf8_utf32 (iconv_t cd, const uchar *from, size_t flen,
- struct strbuf *to)
+ struct _cpp_strbuf *to)
{
return conversion_loop (one_utf8_to_utf32, cd, from, flen, to);
}
static bool
convert_utf16_utf8 (iconv_t cd, const uchar *from, size_t flen,
- struct strbuf *to)
+ struct _cpp_strbuf *to)
{
return conversion_loop (one_utf16_to_utf8, cd, from, flen, to);
}
static bool
convert_utf32_utf8 (iconv_t cd, const uchar *from, size_t flen,
- struct strbuf *to)
+ struct _cpp_strbuf *to)
{
return conversion_loop (one_utf32_to_utf8, cd, from, flen, to);
}
@@ -530,7 +532,7 @@
/* Identity conversion, used when we have no alternative. */
static bool
convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED,
- const uchar *from, size_t flen, struct strbuf *to)
+ const uchar *from, size_t flen, struct _cpp_strbuf *to)
{
if (to->len + flen > to->asize)
{
@@ -547,7 +549,7 @@
#if HAVE_ICONV
static bool
convert_using_iconv (iconv_t cd, const uchar *from, size_t flen,
- struct strbuf *to)
+ struct _cpp_strbuf *to)
{
ICONV_CONST char *inbuf;
char *outbuf;
@@ -873,7 +875,7 @@
static const uchar *
convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit,
- struct strbuf *tbuf, bool wide)
+ struct _cpp_strbuf *tbuf, bool wide)
{
cppchar_t ucn;
uchar buf[6];
@@ -900,7 +902,7 @@
static void
emit_numeric_escape (cpp_reader *pfile, cppchar_t n,
- struct strbuf *tbuf, bool wide)
+ struct _cpp_strbuf *tbuf, bool wide)
{
if (wide)
{
@@ -948,7 +950,7 @@
number. You can, e.g. generate surrogate pairs this way. */
static const uchar *
convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit,
- struct strbuf *tbuf, bool wide)
+ struct _cpp_strbuf *tbuf, bool wide)
{
cppchar_t c, n = 0, overflow = 0;
int digits_found = 0;
@@ -999,7 +1001,7 @@
number. */
static const uchar *
convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit,
- struct strbuf *tbuf, bool wide)
+ struct _cpp_strbuf *tbuf, bool wide)
{
size_t count = 0;
cppchar_t c, n = 0;
@@ -1036,7 +1038,7 @@
pointer. Handles all relevant diagnostics. */
static const uchar *
convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit,
- struct strbuf *tbuf, bool wide)
+ struct _cpp_strbuf *tbuf, bool wide)
{
/* Values of \a \b \e \f \n \r \t \v respectively. */
#if HOST_CHARSET == HOST_CHARSET_ASCII
@@ -1128,7 +1130,7 @@
cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
cpp_string *to, bool wide)
{
- struct strbuf tbuf;
+ struct _cpp_strbuf tbuf;
const uchar *p, *base, *limit;
size_t i;
struct cset_converter cvt
Index: cpphash.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpphash.h,v
retrieving revision 1.200
diff -u -r1.200 cpphash.h
--- cpphash.h 19 Sep 2003 00:47:52 -0000 1.200
+++ cpphash.h 26 Sep 2003 05:50:40 -0000
@@ -35,10 +35,10 @@
struct directive; /* Deliberately incomplete. */
struct pending_option;
struct op;
-struct strbuf;
+struct _cpp_strbuf;
typedef bool (*convert_f) (iconv_t, const unsigned char *, size_t,
- struct strbuf *);
+ struct _cpp_strbuf *);
struct cset_converter
{
convert_f func;
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html