RicardasSim

header version

Apr 9th, 2020
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1. /*
  2. -std=c99 -Wall -Wextra -Wpedantic -Wshadow
  3.  
  4. test_incl.h
  5. --------------------
  6.  
  7. #ifndef TEST_INCL_H
  8. #define TEST_INCL_H
  9.  
  10. #define TEST_INCL_HEADER_VERSION 123
  11.  
  12. #endif // TEST_INCL_H
  13.  
  14. another_incl.h
  15. --------------------
  16.  
  17. #ifndef ANOTHER_INCL_H
  18. #define ANOTHER_INCL_H
  19.  
  20. #include "test_incl.h"
  21.  
  22. #if TEST_INCL_HEADER_VERSION < 100
  23.  
  24. #define TEST_DEF 10
  25.  
  26. #elif TEST_INCL_HEADER_VERSION < 200
  27.  
  28. #define TEST_DEF 20
  29.  
  30. #else
  31.  
  32. #define TEST_DEF 30
  33.  
  34. #endif
  35.  
  36. #endif // ANOTHER_INCL_H
  37.  
  38. */
  39.  
  40. #include <stdio.h>
  41. #include <stdlib.h>
  42. #include "another_incl.h"
  43.  
  44. int main()
  45. {
  46.  
  47.     printf("%d\n", TEST_DEF);
  48.  
  49.     return 0;
  50. }
  51.  
  52. /*
  53. output:
  54.  
  55. 20
  56.  
  57. */
Advertisement
Add Comment
Please, Sign In to add comment