test-ifdef.nut 950 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #define NESTED_INCLUDE
  2. #ifdef NESTED_INCLUDE
  3. #include "test-array.nut"
  4. #else
  5. #include <stdio.h>
  6. #endif
  7. # define DEBUG
  8. print("Top !");
  9. #ifndef ANY
  10. print("Any !");
  11. #ifdef SOME
  12. print("Some !");
  13. #define ANY3
  14. #ifdef NESTED
  15. print("Some nested !");
  16. #ifdef NESTED2
  17. print("Some nested2 !");
  18. #else
  19. print("Else Some nested2 !");
  20. #endif
  21. #else
  22. #ifdef NESTED3
  23. print("Some nested3 !");
  24. #else
  25. print("Else Some nested3 !");
  26. #endif
  27. print("Else Some nested !");
  28. #endif
  29. #endif
  30. print("Another any !");
  31. #ifndef ANY2
  32. print("Any2 !");
  33. #ifdef ANY3
  34. print("Any3 !");
  35. #else
  36. print("Esle Any3 !");
  37. #endif
  38. #ifndef ANY4
  39. print("Any4 !");
  40. #else
  41. print("Esle Any4 !");
  42. #endif
  43. print("Another any2 !");
  44. #endif
  45. #endif
  46. #ifdef DEBUG
  47. print("Debug code");
  48. #else
  49. print("Non debug code");
  50. #endif
  51. #undef DEBUG
  52. #ifdef DEBUG
  53. print("Debug code2");
  54. #else
  55. print("Non debug code2");
  56. #endif
  57. print("Botton !");