diff options
author | Momtchil Momtchev <momtchil@momtchev.com> | 2023-04-17 12:22:41 +0200 |
---|---|---|
committer | Momtchil Momtchev <momtchil@momtchev.com> | 2023-04-17 12:22:41 +0200 |
commit | 6e54f3b6c402e3710e14b57e0a9978177fce50dc (patch) | |
tree | 9d2776b70832d75254cd2aa7e8a17f865ba4a722 /Examples | |
parent | 3828b247be412fb368f4c0f2d6935335707c3b31 (diff) | |
download | swig-6e54f3b6c402e3710e14b57e0a9978177fce50dc.tar.gz |
inline the header into the interface file
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/test-suite/preproc_defined.h | 21 | ||||
-rw-r--r-- | Examples/test-suite/preproc_defined.i | 26 |
2 files changed, 25 insertions, 22 deletions
diff --git a/Examples/test-suite/preproc_defined.h b/Examples/test-suite/preproc_defined.h deleted file mode 100644 index 1e60ca116..000000000 --- a/Examples/test-suite/preproc_defined.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This should not compile in when this bug is present - * https://github.com/swig/swig/issues/2525 - */ - -#define my_bad_attr __attribute__ -#define my_good_attr(x) __attribute__(x) - -int bad my_bad_attr((used)); -int good my_good_attr((used)); - -/* - * The behaviour of Self-Referential Macros is defined - * https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Self-Referential-Macros.html - */ -int y = 0; - -#define x (4 + y) -#define y (2 * x) - -int z = y; diff --git a/Examples/test-suite/preproc_defined.i b/Examples/test-suite/preproc_defined.i index 21afa86ec..de654df36 100644 --- a/Examples/test-suite/preproc_defined.i +++ b/Examples/test-suite/preproc_defined.i @@ -125,4 +125,28 @@ void another_macro_checking(void) { #endif #define __attribute__(x) -%import <preproc_defined.h> +%inline %{ +/* + * This should not compile in when this bug is present + * https://github.com/swig/swig/issues/2525 + */ +#define my_bad_attr __attribute__ +#define my_good_attr(x) __attribute__(x) + +int bad my_bad_attr((used)); +int good my_good_attr((used)); + +/* + * The behaviour of Self-Referential Macros is defined + * https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Self-Referential-Macros.html + */ +int y = 0; + +#define x (4 + y) +#define y (2 * x) + +int z = y; + +#undef y +#undef x +%} |