This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/Python] Fix procfs.c build failure on 32bit solaris (_FILE_OFFSET_BITS)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]