This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


 
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@TucsonEmbedded.com
5620 N. Kolb Road 
Suite 160 
Tucson, AZ 85750-1384


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]