From: Rainer Orth Date: Fri, 5 Aug 2011 12:14:55 +0000 (+0000) Subject: tsystem.h (CONST_CAST2, CONST_CAST): Define. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96c891b30a01cfead4d47530d1a2d78ebff13e1a;p=gcc.git tsystem.h (CONST_CAST2, CONST_CAST): Define. gcc: * tsystem.h (CONST_CAST2, CONST_CAST): Define. gcc/ada: * init.c [__alpha__ && __osf__] (__gnat_error_handler): Use CONST_CAST. From-SVN: r177427 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0087f055385..cb2adc82514 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-08-05 Rainer Orth + + * tsystem.h (CONST_CAST2, CONST_CAST): Define. + 2011-08-05 Ira Rosen * tree-vect-loop.c (vect_create_epilog_for_reduction): Use the diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6162166601a..6a0b21d0c22 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2011-08-05 Rainer Orth + + * init.c [__alpha__ && __osf__] (__gnat_error_handler): Use + CONST_CAST. + 2011-08-04 Ed Schonberg * sem_util.ads, sem_unit.adb (Type_Without_Stream_Operation): determine diff --git a/gcc/ada/init.c b/gcc/ada/init.c index df0bb932ca7..a8a94269c33 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -379,7 +379,7 @@ __gnat_error_handler (int sig, siginfo_t *si, void *ucontext) } recurse = 0; - Raise_From_Signal_Handler (exception, (char *) msg); + Raise_From_Signal_Handler (exception, CONST_CAST (char *, msg)); } void diff --git a/gcc/tsystem.h b/gcc/tsystem.h index fc7713c9d13..3a5f3c61649 100644 --- a/gcc/tsystem.h +++ b/gcc/tsystem.h @@ -1,6 +1,7 @@ /* Get common system includes and various definitions and declarations based on target macros. - Copyright (C) 2000, 2001, 2004, 2005, 2009 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2004, 2005, 2009, 2011 + Free Software Foundation, Inc. This file is part of GCC. @@ -128,6 +129,9 @@ extern int errno; unreachable default case of a switch. Do not use gcc_assert(0). */ #define gcc_unreachable() (abort ()) +#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq) +#define CONST_CAST(TYPE,X) CONST_CAST2(TYPE, const TYPE, (X)) + /* Filename handling macros. */ #include "filenames.h"