Re: help with preprocessor tricks

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

 



On Tue, 26 Feb 2002, J Pradeep wrote:

> 
> I could not understand what you were doing with that if-statement. The
> following works for me:
> 
> #define k_message(msg...) printk(KERN_INFO msg)

This works for me too! I want to append a '\n' to msg. I cant get that to 
work.

> if you want to make it conditional w.r.t. MYDEBUG it would look like
> 
> #ifdef MYDEBUG
>   #define ...
> #else
>   #define ...
> #endif

The 'if' statement allows me to enable/disable certain types of debug 
statements by changing a single flag (MYDBG1 in this case)

> On Mon, 25 Feb 2002, Amit Kucheria wrote:
> 
> > Hi,
> > 
> > I have the following code:
> > --------------------------------
> > #define NEWLN "\n"
> > 
> > #define MYDBG1 1
> > #define MYDEBUG1(fmt, args...) \
> >   if (MYDBG1) printk(KERN_DEBUG fmt NEWLN, ## args )
> > --------------------------------

-- 
The statement below is true.
The statement above is false.
^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^
                  Amit Kucheria
          EECS Grad. Research Assistant
         University of Kansas @ Lawrence
   (R)+1-(785)-830 8521 ||| (O)+1-(785)-864 7774
____________________________________________________

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[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