PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/preproc_include.i

#
Swig | 52 lines | 39 code | 13 blank | 0 comment | 0 complexity | ec3bd9b738185688642f86a02e7a5de7 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module preproc_include
  2. %{
  3. #include "preproc_include_a.h"
  4. #include "preproc_include_b.h"
  5. int multiply10(int a) { return a*10; }
  6. int multiply20(int a) { return a*20; }
  7. int multiply30(int a) { return a*30; }
  8. int multiply40(int a) { return a*40; }
  9. int multiply50(int a) { return a*50; }
  10. %}
  11. #define INCLUDE_B preproc_include_b.h
  12. #define FILE_INCLUDE(FNAME) #FNAME
  13. %include FILE_INCLUDE(preproc_include_a.h)
  14. // Note that this test uses -includeall, so including preproc_include_b.h also includes preproc_include_c.h
  15. %include INCLUDE_B
  16. %include"preproc_include_d withspace.h"
  17. #define INCLUDE_E "preproc_include_e withspace.h"
  18. %include INCLUDE_E
  19. %inline %{
  20. #define INCLUDE_F /*comments*/ "preproc_include_f withspace.h"/*testing*/
  21. #include INCLUDE_F
  22. #include /*oooo*/"preproc_include_g.h"/*ahhh*/
  23. %}
  24. %{
  25. int multiply60(int a) { return a*60; }
  26. int multiply70(int a) { return a*70; }
  27. %}
  28. %define nested_include_1(HEADER)
  29. %include <HEADER>
  30. %enddef
  31. %define nested_include_2(HEADER)
  32. nested_include_1(HEADER);
  33. %enddef
  34. %define nested_include_3(HEADER)
  35. nested_include_2(HEADER);
  36. %enddef
  37. nested_include_1(preproc_include_h1.i);
  38. nested_include_2(preproc_include_h2.i);
  39. nested_include_3(preproc_include_h3.i);