This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: new cpp preprocessor fails


On 14 Nov, Neil Booth wrote:
> Please provide all the macros needed to reproduce your result.

OK, I've boiled it down to
-------------------------------------------------------------------------------

#define UNUSED __attribute__((__unused__))
#define INLINE __inline__
#  define INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE UNUSED
#define M 8
INLINE_SIM_ENDIAN(unsigned_8) endian_t2h_8(unsigned_8 x);
#define T2H_8(X) endian_t2h_8(X)

#define CONCAT2(a,b)	 a##b
#define XCONCAT2(a,b)     CONCAT2(a,b)
#define unsigned_M XCONCAT2(unsigned_,M)

#define T2H_M XCONCAT2(T2H_,M)

/* the following 2 lines are just a workaround */
      typedef unsigned_M HJ_Type;
      val = T2H_M (*( HJ_Type *) sim_core_translate (mapping, addr));

/* the following line expands to
      val = endian_t2h_8(*(XCONCAT2(unsigned_,8)*) sim_core_translate (mapping, 
*/
      val = T2H_M (*(unsigned_M*) sim_core_translate (mapping, addr));
      
-------------------------------------------------------------------------------

-- 
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
Institute of Technology, RWTH Aachen
D 52056 Aachen, Germany


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