[patch] _LONG_LONG conflicts with pre-define of the XL compiler

Jeff Johnston jjohnstn@redhat.com
Thu Apr 24 15:45:00 GMT 2008


Patch checked in.

-- Jeff J.

Ken Werner wrote:
> Hi,
>
> newlib 1.16.0 has brought a _LONG_LONG define that gets expanded to long long:
> http://sourceware.org/cgi-bin/cvsweb.cgi/src/newlib/libc/include/_ansi.h?cvsroot=src
> This conflicts with the pre-define _LONG_LONG of the XL compiler which is
> defined to 1 when long long data types are available:
> http://publib.boulder.ibm.com/infocenter/lnxpcomp/v9v111/index.jsp?topic=/com.ibm.xlcpp9.linux.doc/compiler_ref/opt_longlong.htm
> Currently this macro is only used math.h newlib. I created a small patch that
> renames _LONG_LONG to _LONG_LONG_TYPE. Is this patch ok for apply?
>
> Ken
>
> newlib/ChangeLog:
>
> 2008-04-23 Ken Werner  <ken.werner@de.ibm.com>
> 	* libc/include/_ansi.h: _LONG_LONG renamed to _LONG_LONG_TYPE.
> 	* libc/include/math.h: Likewise.
>
> Index: newlib/libc/include/_ansi.h
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/include/_ansi.h,v
> retrieving revision 1.5
> diff -u -r1.5 _ansi.h
> --- newlib/libc/include/_ansi.h	19 Dec 2007 22:20:25 -0000	1.5
> +++ newlib/libc/include/_ansi.h	23 Apr 2008 19:29:52 -0000
> @@ -45,8 +45,8 @@
>  #ifndef _LONG_DOUBLE
>  #define _LONG_DOUBLE long double
>  #endif
> -#ifndef _LONG_LONG
> -#define _LONG_LONG long long
> +#ifndef _LONG_LONG_TYPE
> +#define _LONG_LONG_TYPE long long
>  #endif
>  #ifndef _PARAMS
>  #define _PARAMS(paramlist)		paramlist
> @@ -65,7 +65,7 @@
>  #define	_DEFUN_VOID(name)		name()
>  #define _CAST_VOID
>  #define _LONG_DOUBLE double
> -#define _LONG_LONG long
> +#define _LONG_LONG_TYPE long
>  #ifndef _PARAMS
>  #define _PARAMS(paramlist)		()
>  #endif
> Index: newlib/libc/include/math.h
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/include/math.h,v
> retrieving revision 1.32
> diff -u -r1.32 math.h
> --- newlib/libc/include/math.h	19 Dec 2007 22:20:25 -0000	1.32
> +++ newlib/libc/include/math.h	23 Apr 2008 19:29:52 -0000
> @@ -226,7 +226,7 @@
>  extern double tgamma _PARAMS((double));
>  extern double nearbyint _PARAMS((double));
>  extern long int lrint _PARAMS((double));
> -extern _LONG_LONG int llrint _PARAMS((double));
> +extern _LONG_LONG_TYPE int llrint _PARAMS((double));
>  extern double round _PARAMS((double));
>  extern long int lround _PARAMS((double));
>  extern double trunc _PARAMS((double));
> @@ -293,7 +293,7 @@
>  extern float tgammaf _PARAMS((float));
>  extern float nearbyintf _PARAMS((float));
>  extern long int lrintf _PARAMS((float));
> -extern _LONG_LONG llrintf _PARAMS((float));
> +extern _LONG_LONG_TYPE llrintf _PARAMS((float));
>  extern float roundf _PARAMS((float));
>  extern long int lroundf _PARAMS((float));
>  extern float truncf _PARAMS((float));
> @@ -335,7 +335,7 @@
>  /* Other long double precision functions.  */
>  extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE));
>  extern long int lrintl _PARAMS((_LONG_DOUBLE));
> -extern _LONG_LONG llrintl _PARAMS((_LONG_DOUBLE));
> +extern _LONG_LONG_TYPE llrintl _PARAMS((_LONG_DOUBLE));
>  
>  #endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */
>  
>   



More information about the Newlib mailing list