This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, fixincludes] Fix NULL on AIX
- From: Bruce Korb <bkorb at gnu dot org>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>
- Date: Tue, 30 Apr 2013 08:28:38 -0700
- Subject: Re: [PATCH, fixincludes] Fix NULL on AIX
- References: <CAGWvny=3PiUFQQwNKpAxTX1G1tXB8HfoOUwkmRpvdi2WyKhAXg at mail dot gmail dot com>
Hi David,
Looks good to me, but for a small nit:
On Tue, Apr 30, 2013 at 7:40 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> + c_fix_arg = "#ifndef NULL\n"
> + "#ifdef __cplusplus\n"
> + "#ifdef __GNUG__\n"
> + "#define NULL\t__null\n"
> + "#else\t /* ! __GNUG__ */\n"
> + "#define NULL\t0L\n"
> + "#endif\t /* __GNUG__ */\n"
> + "#else\t /* ! __cplusplus */\n"
> + "#define NULL\t((void *)0)\n"
> + "#endif\t /* __cplusplus */\n"
> + "#endif\t /* !NULL */";
I'd really prefer a "here string":
c-fix-arg = <<- _EOF_
#ifndef NULL
#ifdef __cplusplus
#ifdef __GNUG__
#define NULL __null
#else /* ! __GNUG__ */
#define NULL 0L
#endif /* __GNUG__ */
#else /* ! __cplusplus */
#define NULL ((void *)0)
#endif /* __cplusplus */
#endif /* !NULL */
_EOF_;
Unless there is some reason you want to emphasize tabs with the "\t" escapes.
I think the "here string" is easier to read.