   macro and #
  i using diffrent levels of debug, which are checked at compile timehere''s something i''m trying to do, to ease the typing #define DLOG(cond1,cond2,do_log) #if( (SDK_DEBUG_LEVEL >= cond1) && cond2) do_log   #endifbut it does not work, since # is a string-anize operator. how to handle this? 
  This should work I think. #if( (SDK_DEBUG_LEVEL >= cond1) && cond2)#define DLOG(cond1,cond2,do_log) do_log#else#define DLOG(cond1,cond2,do_log)#endif ;  @sazzer???this is how i do it now: void func(){   #if( (SDK_DEBUG_LEVEL >= DEBUG_MAX) && DEBUG_THIS_FUNC)gLog.Info("func() called");   #endif}and i would like something like this: void func(){   DLOG(DEBUG_MAX,DEBUG_THIS_FUNC,gLog.Info("func() called");)}but, i doesn''t works since # (from #if) works as string-anize operator.;  Which is why you need to do what was suggested.;  i dont get it...#if( (SDK_DEBUG_LEVEL >= cond1) && cond2)#define DLOG(cond1,cond2,do_log) do_log#else#define DLOG(cond1,cond2,do_log)#endif cond1,cond2 are macro "variables", so how can they influence on the condition which is "above" them? ;  Do like this#define DLOG(cond1,cond2,do_log) if( (SDK_DEBUG_LEVEL >= cond1) && cond2) do_logNow the if isn''t a macro #if. But if the expression can be evaluated as "false" at compile time, then it''s likely that the compiler will optimize it away entirely. Try it out. ;  @civguyi always forget to ask this, how do u "see" code after the preprocessor does his job? working in vc6 ;quote:Original post by original vesoljc  @civguyi always forget to ask this, how do u "see" code after the preprocessor does his job? working in vc6   I don''t know, never needed it. But the if(false) isn''t optimized away by the preprosessor so it wouldn''t be useful here anyway. ;  so i thought...and after the compiler does his job? is there a simpler way than checking assembly code? must admin, i dont alot bout asm... ;  I''m curious as to why macros aren''t allowed to have preprocessor directives other than stringizing and concatenation.  This would lend quite a bit of flexibility to the language, albeit a bit more difficult for the preprocessor.   ______________________________________________________________The Phoenix shall arise from the ashes...   ThunderHawk -- ¦þMySite______________________________________________________________ 