[PATCH, reviewed]: Fixes undefined size_t compile errors onHPUX11.00
Bruce Korb
bkorb@pacbell.net
Thu Sep 6 20:21:00 GMT 2001
Josh Martin wrote:
>
> Bruce,
>
> I wanted to pass this inclhack.def patch by you before I posted to gcc-bugs and
> gcc-patches. This is the "ideal" fix alluded to in the gcc-patches post at
> http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01640.html
> and replaces it completely.
I never saw the first post. I don't read all postings. :-}
Anyway, it looks reasonable to me, but the test text needs to be
cut down a bit...See below. Also, a 'format' c_fix will be
"more efficient" i.e., "preferred". Thanks - Bruce
> 2001-09-05 Josh Martin <josh.martin@abq.sc.philips.com>
>
> * fixinc/inclhack.def(hpux11_size_t): Keep HP-UX headers from
> defining __size_t and leaving size_t undefined.
>
>
> --- /usr/local/build/gcc-3.0.1/gcc/fixinc/inclhack.def Thu Jul 19 22:04:48 2001
> +++ inclhack.def Wed Sep 5 14:38:53 2001
> @@ -1212,6 +1213,34 @@ fix = {
> "#ifdef _PA_RISC\n"
> "# define fabsf(x) ((float)fabs((double)(float)(x)))\n"
> "#endif";
> +};
> +
> +
> +/*
> + * Prevent HP-UX 11 from defining __size_t and preventing size_t from
> + * being defined by having it define _hpux_size_t instead.
> + */
> +fix = {
> + hackname = hpux11_size_t;
> + files = ctype.h, errno.h, locale.h, malloc.h, pwd.h, setjmp.h;
> + files = stddef.h, stdio.h, stdlib.h, string.h, time.h, utime.h;
> + files = varargs.h, wchar.h;
> + mach = "*-hp-hpux*";
> + select = "^#ifdef _NAMESPACE_STD";
> +
> + c_fix = format;
> + c_fix_arg = "_hpux_size_t";
> + c_fix_arg = "__size_t";
> +
> + test_text =
> + "#ifdef _NAMESPACE_STD\n"
> + "#define __size_t std::size_t\n"
> + " extern int getpwuid_r(uid_t, struct passwd *, char *, __size_t,
> struct passwd **);\n";
> };
These test text lines were superfluous and get in the way of the testing:
> + "#define _NAMESPACE_STD_START namespace std {\n"
> + "#define _NAMESPACE_STD_END }\n"
> + "#define __time_t std::time_t\n"
> + "#define __FILE std::FILE\n"
> + "#define __wint_t std::wint_t\n"
> + "#define __struct_tm std::tm\n"
> + "#define __va__list std::va_list\n"
More information about the Gcc-patches
mailing list