Re: #ifdef statement inside #define

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello,

> Has anyone an idea how to code following macro:

> #define INIT()    \
> 
>     #ifdef THREDSAFE        \
> 
>               lock_mutex()   \
> 
>     #endif    \
> 

maybe...

#ifdef THREDSAFE
  #define INIT() lock_mutex()
#else
  #define INIT() do {} while (0)
#endif

regards,

toni

> The error ist that after a # operator there is an parameter expected.
> The normal escape doesn't help in this case.
> 
> Shure I can write this in every line I need it but I want to have a
> macro.
> 
> CU
> 
> Katharina
> 
> 
> 
> 
> Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu
> sparen!   
> http://smartsurfer.web.de/?mc=100071&distributionid=000000000071  
-- 
toni <agar9938@xxxxxxxxxxxxxxxxxx>



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux