fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. #define DEBUG
  6.  
  7. #ifdef DEBUG
  8. #define DECLARE_DEBUG_PARAM(x) x
  9. #define PASS_DEBUG_PARAM(x) x
  10. #else
  11. #define DECLARE_DEBUG_PARAM(x) void
  12. #define PASS_DEBUG_PARAM(x)
  13. #endif
  14.  
  15. int foo(DECLARE_DEBUG_PARAM(const bool param)) {
  16. #ifdef DEBUG
  17. if(param) {
  18. cout << "DEBUG true\n";
  19. } else {
  20. cout << "DEBUG false\n";
  21. }
  22. #else
  23. cout << "RETAIL\n";
  24. #endif
  25. }
  26.  
  27. int main() {
  28. foo(PASS_DEBUG_PARAM(true));
  29. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
DEBUG true