diff options
Diffstat (limited to 'gcc/fixinc/inclhack.def')
-rw-r--r-- | gcc/fixinc/inclhack.def | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 534a0b419c4..d62c12c00fa 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -2277,6 +2277,31 @@ fix = { /* + * Fix casts as lvalues in glibc's <rpc/xdr.h>. + */ +fix = { + hackname = rpc_xdr_lvalue_cast_a; + files = rpc/xdr.h; + select = "#define[ \t]*IXDR_GET_LONG.*\\\\\n.*__extension__.*"; + c_fix = format; + c_fix_arg = "#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))"; + test_text = "#define IXDR_GET_LONG(buf) \\\\\n" + "\t((long)ntohl((u_long)*__extension__((u_int32_t*)(buf))++))"; +}; + + +fix = { + hackname = rpc_xdr_lvalue_cast_b; + files = rpc/xdr.h; + select = "#define[ \t]*IXDR_PUT_LONG.*\\\\\n.*__extension__.*"; + c_fix = format; + c_fix_arg = "#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))"; + test_text = "#define IXDR_PUT_LONG(buf, v) \\\\\n" + "\t(*__extension__((u_int32_t*)(buf))++ = (long)htonl((u_long)(v)))"; +}; + + +/* * function class(double x) conflicts with C++ keyword on rs/6000 */ fix = { |