As wrappers for debug functions, to automatically pass things like __FILE__
, __LINE__
, etc:
#ifdef ( DEBUG )
#define M_DebugLog( msg ) std::cout << __FILE__ << ":" << __LINE__ << ": " << msg
#else
#define M_DebugLog( msg )
#endif
More Related Contents:
- What is the difference between #include and #include “filename”?
- Why use apparently meaningless do-while and if-else statements in macros?
- C++ preprocessor __VA_ARGS__ number of arguments
- C/C++ macro string concatenation
- Can we have recursive macros?
- C/C++ line number
- Is it legal to redefine a C++ keyword?
- Error: invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’
- How to identify platform/compiler from preprocessor macros?
- Common array length macro for C? [duplicate]
- Can you make custom operators in C++?
- Escaping a # symbol in a #define macro?
- C/C++, can you #include a file into a string literal? [duplicate]
- Portability of #warning preprocessor directive
- How to make G++ preprocessor output a newline in a macro?
- Naming Include Guards
- C/C++ macro/template blackmagic to generate unique name
- Can the C preprocessor be used to tell if a file exists?
- Difference between Enum and Define Statements
- macro definition containing #include directive
- What does “#define STR(a) #a” do?
- C++: Can a macro expand “abc” into ‘a’, ‘b’, ‘c’?
- GCC, stringification, and inline GLSL?
- “No newline at end of file” compiler warning
- Header file included only once in entire program?
- Confused by squaring macro SQR in c [duplicate]
- What is the difference between #define and const? [duplicate]
- C++ #include semantics
- Is there a way to do a #define inside of another #define?
- Are Variadic macros nonstandard?