swig/Examples/test-suite/import_fragments_a.i
Vadim Zeitlin 17fbb0a528 Include required headers for %imported modules
We need the types from the imported modules, so #include the header
generated for it.

Unfortunately we have to half-guess the name used for that header, as
it's not available anywhere (and can't really be, as it could be changed
by a command line option used for another SWIG invocation that was used
to compile that module), but this seems to work well enough in practice.

In particular, this fixes failures in multi cpp tests, so that we don't
need FAILING_MULTI_CPP_TESTS any longer.
2021-11-27 00:19:05 +01:00

48 lines
924 B
OpenEdge ABL

#if !defined(SWIGC) && !defined(SWIGGO)
// Prevent C/Go from generating a C include/Go module import - this test is not set up as true multiple modules
%module import_fragments_a
#endif
%fragment("ImportA1", "header") %{
ImportA1_this_will_not_compile;
%}
%fragment("ImportA2", "header") %{
ImportA2_this_will_not_compile;
%}
%fragment("ImportA3", "header") %{
ImportA3_this_will_not_compile;
%}
%fragment("ImportA4", "header") %{
static int ImportA4 = 99;
%}
%fragment("ImportA5", "header") %{
ImportA5_this_will_not_compile;
%}
%fragment("ImportA1");
%{
Import_will_not_compile;
%}
struct StructA {
%fragment("ImportA2");
};
template<typename T>
struct TemplateA3 {
%fragment("ImportA3");
};
template<typename T>
struct TemplateA4 {
%fragment("ImportA4");
};
template<typename T>
struct TemplateA5 {
%fragment("ImportA5");
};
%template(TemplateA5Double) TemplateA5<double>;
%include "import_fragments_b.i"