C/C++ Preprocessor -- #ifdef to if(){....}

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

 



 
Is there a slick-but-evil (preprocessor?) mechanism to replace
-----------------------
#ifdef DEBUG_XXX
    printf("Some debug data\n");
#endif
-----------------------
With 
=============================
extern "C" int global_debug_print;
if(global_debug_print>0){
    printf("Some debug data\n");
}
=============================
While not touching other '#if ... [#else] ... #endif' constructs


Elden Crom
Tucson Embedded Systems, Inc
520-575-7283 x141
Fax: 520-575-5563
Cell: 520-429-2771
Email:EldenC@xxxxxxxxxxxxxxxxxx
5620 N. Kolb Road 
Suite 160 
Tucson, AZ 85750-1384



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux