PROBLEM: Compatibility problem with C++, i386 & ia64 platform

From: Joakim Bentholm XQ (AS/EAB) (joakim.xq.bentholm_at_ericsson.com)
Date: 11/23/04

  • Next message: Ingo Molnar: "Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm2-V0.7.30-2"
    To: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
    Date:	Tue, 23 Nov 2004 13:54:12 +0100
    
    

    1. Compatibility errors when including <asm/system.h> with g++ compiler on i386 and ia64 platforms.

    If you want to use the memory barrier macros mb(), rmb() and wmb(), as defined in <asm/system.h>.

    On i386 platform:
    This will work if you use gcc, but not in g++, since the name of the parameter in the __cmpxchg(...) is new, which the C++ compiler will not accept. (new_val might have been a better choice ;-)

    Function header

    ---
    static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
    				      unsigned long new, int size)
    ---
    On Itanium 2 platform:
    Compiling on Itanium 2 works if you add som typedefs and a define, which is normally defined when __KERNEL__ is enabled. 
    Prepended rows to the include of system.h
    ---
    #define __pa(x) x
    typedef long s64;
    typedef int s32;
    typedef unsigned long u64;
    typedef unsigned int u32;
    #include <asm/system.h>
    ---
    Maybe the system.h is not supposed to be included outside the kernel?
    Is there a less crude way of getting hold of the macros?
    Best Regards/JB
    --
    Joakim Bentholm
    joakim.xq.bentholm@ericsson.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Ingo Molnar: "Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm2-V0.7.30-2"

    Relevant Pages

    • Re: data types
      ... ...but the manual for the compiler I am using says int is 16-bit. ... typedef [whatever type is 16 bits in your platform] int16; ...
      (comp.lang.c)
    • Re: VS2005 doesnt like its own suggestions
      ... >> But I think the answer to your original question is that since INT ... >> Imaging you move your INT code to a 64 bit platform and rebuild. ... >> typedef short INT; ... > They were simply aliases for int/unsigned int. ...
      (microsoft.public.vc.language)
    • Re: data types
      ... ...but the manual for the compiler I am using says int is ... typedef [whatever type is 16 bits in your platform] int16; ... instead of plain int in your code. ...
      (comp.lang.c)
    • Re: data types
      ... ...but the manual for the compiler I am using says int is ... typedef [whatever type is 16 bits in your platform] int16; ... instead of plain int in your code. ...
      (comp.lang.c)
    • Bypassing Personal Firewalls
      ... typedef SOCKET (int, int, int); ... typedef int (__stdcall *func_connect)(SOCKET, const struct sockaddr ... typedef HANDLE (LPCTSTR, DWORD, DWORD, ...
      (Bugtraq)