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

# · Swig · 33 lines · 17 code · 11 blank · 5 comment · 0 complexity · 88fd0def0b0526ce0943585ddc6ccb2c MD5 · raw file

  1. /* This is a test case for -*- C -*- mode. */
  2. %module tag_no_clash_with_variable
  3. %inline %{
  4. /* error_action is only a tag, not a type... */
  5. enum error_action {
  6. ERRACT_ABORT,
  7. ERRACT_EXIT,
  8. ERRACT_THROW
  9. };
  10. /* ... thus it does not clash with a variable of the same name. */
  11. enum error_action error_action;
  12. /* Likewise for structs: */
  13. struct buffalo {
  14. int foo;
  15. };
  16. struct buffalo buffalo;
  17. /* And for union */
  18. union onion {
  19. int cheese;
  20. };
  21. union onion onion;
  22. %}