Hi Thomas, Thank you and all very much Thanks Sudheer.A Mike DeKoker wrote: --- sudheer <urwithsudheer@xxxxxxxxx> wrote:Hi Thomas, Thomas Petazzoni wrote:Hi, Le Fri, 05 May 2006 18:02:48 +0530, sudheer <urwithsudheer@xxxxxxxxx> a écrit :To have the compatability i have used the macroCONFIG_X86_64 in.config .Why do you need to differentiate code executed on32 bits platforms >from code executed on 64 bits platform ? Generally speaking, your codeshould be portable, and not rely on CONFIG_X86_64or other options ofthe same kind.I want to assign some data to a long pointer variable SysAdddr. #ifdef CONFIG_64 *(SysAddr + num_items) = (0xaa55aa55aa000000 + num_items); #else *(SysAddr + num_items) = (0x11220000 + (num_items)); #endif If it is 64 but system i should assign 64 bit or else 32 bit data. Can i have any other option/method ? Thanks SudheerAs previously mentioned your code should be portable and not rely on architecture specific things like pointer size. That being said, here's another way to do this at roughly compile time: if (sizeof(long) > 4) { *(SysAddr + num_items) = (0xaa55aa55aa000000 + num_items); } else { *(SysAddr + num_items) = (0x11220000 + (num_items)); } The optimizer should remove the extraneous branch of code. Mike DeKoker Signatec, Inc. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |