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

Re: c macro



Erez Doron <erez@savan.com> wrote:

>  I'm tring to make any  on that uses printf to
>  use sprintf instead
>  
>  somthing like:
>  
>  #ifdef LINUX
>  #define printf(...) {sprintf(s,...);do_print(s);}
>  #endif

static char s[256];
#define printf(args... ) sprintf(s, ## args); do_print(s)

Notice that it's a GCC extension; in the ANSI C there is no way of doing such a
thing.

Regards,

Evgeny


--
   ____________________________________________________________
  / Evgeny Stambulchik  <fnevgeny@plasma-gate.weizmann.ac.il>  \
 /  Plasma Laboratory, Weizmann Institute of Science, Israel \  \
 |  Phone : (972)8-934-3610  == | == FAX   : (972)8-934-3491 |  |
 |  URL   :    http://plasma-gate.weizmann.ac.il/~fnevgeny/  |  |
 |  Finger for PGP key >=====================================+  | 
 |______________________________________________________________|