diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2021-12-22 19:06:00 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2021-12-22 19:06:00 +0000 |
commit | 2d76057571a77609060d6c6c05f151ec608aa58d (patch) | |
tree | 5fe9b3c8a90e905885dbfabd34b645e9e60115b5 | |
parent | 1b22fef8ad531c768b10353bbb8e625c23d85b5c (diff) | |
download | swig-2d76057571a77609060d6c6c05f151ec608aa58d.tar.gz |
preproc_cpp test for testing preprocessor and C++
Move C++ comment testing into here.
See 7a9bf3307f9436c0f48eecd155c721c86a0f4058.
-rw-r--r-- | Examples/test-suite/preproc.i | 1 | ||||
-rw-r--r-- | Examples/test-suite/preproc_cpp.i | 36 | ||||
-rw-r--r-- | Examples/test-suite/python/preproc_cpp_runme.py | 4 |
3 files changed, 41 insertions, 0 deletions
diff --git a/Examples/test-suite/preproc.i b/Examples/test-suite/preproc.i index 04398b25a..feff7b489 100644 --- a/Examples/test-suite/preproc.i +++ b/Examples/test-suite/preproc.i @@ -373,6 +373,7 @@ int methodX(int x) { return x+100; } /* Comma in macro - https://github.com/swig/swig/issues/974 (for C comments) and https://github.com/swig/swig/pull/1166 (for //) + Also see preproc_cpp.i */ %inline %{ #define swig__attribute__(x) diff --git a/Examples/test-suite/preproc_cpp.i b/Examples/test-suite/preproc_cpp.i new file mode 100644 index 000000000..c81f9a74f --- /dev/null +++ b/Examples/test-suite/preproc_cpp.i @@ -0,0 +1,36 @@ +%module preproc_cpp + + +// Comma in macro - https://github.com/swig/swig/issues/974 (for /* */) +// and https://github.com/swig/swig/pull/1166 (for //) +// Also see preproc.i +%inline %{ +#define swig__attribute__(x) +#define TCX_PACKED(d) d swig__attribute__ ((__packed__)) + + +TCX_PACKED (typedef struct tcxMessageTestImpl +{ + int mHeader; /**< comment */ +}) tcxMessageTest; + + +TCX_PACKED (typedef struct tcxMessageBugImpl +{ + int mBid; /**< Bid price and size, check PresentMap if available in message */ +}) tcxMessageBug; + + +TCX_PACKED (typedef struct tcxMessageTestImpl2 +{ + int mHeader; ///< comment +}) tcxMessageTest2; + + +TCX_PACKED (typedef struct tcxMessageBugImpl2 +{ + int mBid; ///< Bid price and size, check PresentMap if available in message +}) tcxMessageBug2; + + +%} diff --git a/Examples/test-suite/python/preproc_cpp_runme.py b/Examples/test-suite/python/preproc_cpp_runme.py new file mode 100644 index 000000000..8c3e21237 --- /dev/null +++ b/Examples/test-suite/python/preproc_cpp_runme.py @@ -0,0 +1,4 @@ +import preproc_cpp + +t1 = preproc_cpp.tcxMessageTest() +t2 = preproc_cpp.tcxMessageBug() |