This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/Python] Fix procfs.c build failure on 32bit solaris (_FILE_OFFSET_BITS)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 23 Nov 2010 04:25:31 +0100
- Subject: Re: [RFA/Python] Fix procfs.c build failure on 32bit solaris (_FILE_OFFSET_BITS)
- References: <1290474834-1945-1-git-send-email-brobecker@adacore.com>
On Tue, 23 Nov 2010 02:13:54 +0100, Joel Brobecker wrote:
> +#ifdef _FILE_OFFSET_BITS
> +#define OLD_FILE_OFFSET_BITS _FILE_OFFSET_BITS
> #undef _FILE_OFFSET_BITS
> +#endif
>
> #if HAVE_LIBPYTHON2_4
> #include "python2.4/Python.h"
> @@ -62,6 +69,13 @@ typedef int Py_ssize_t;
> #error "Unable to find usable Python.h"
> #endif
>
> +/* Restore the original _FILE_OFFSET_BITS value if applicable. */
> +#ifdef OLD_FILE_OFFSET_BITS
> +#undef _FILE_OFFSET_BITS
> +#define _FILE_OFFSET_BITS OLD_FILE_OFFSET_BITS
> +#undef OLD_FILE_OFFSET_BITS
> +#endif
> +
Without any comments on the Solaris specifics such saving of macro content
cannot work. cpp macros expand only during their final use, not as right hand
side of a #define line.
_FILE_OFFSET_BITS will have content `OLD_FILE_OFFSET_BITS' at the end, if it
had any content in the beginning.
Regards,
Jan