Is it correct to use such a code?
#define LOGGING #if LOGGING using log4net; using log4net.Config; #endif
Is it correct to use such a code?
#define LOGGING #if LOGGING using log4net; using log4net.Config; #endif
In terms of compilability, yes, correctly: http://ideone.com/b7jxl0
Incorrectly, since the directive is declared, the value is not specified, but it is this value that is checked in if LOGGING. It should be replaced with #ifdef LOGGING, or #define LOGGING 1
#ifdef
. - VladDSource: https://ru.stackoverflow.com/questions/200747/
All Articles