Files
Saleem Abdulrasool 1040116e32 IRGen: rework linking against CxxStdlib
Rewrite the handling for the `CxxStdlib` implicit linking to use a
slightly more functional style for filtering.  Additionally, add Windows
to the list providing the overlay.  The Windows linking scenario is a
slightly more complicated as the library names differ between static and
dynamic variants to disambiguate between import libraries and static
libraries.  Take this into account when embedding the library name so
that the linker can find the appropriate content.
2023-08-08 09:03:37 -07:00

34 lines
882 B
C

#ifndef TEST_INTEROP_CXX_FOREIGN_REFERENCE_INPUTS_NULLABLE_H
#define TEST_INTEROP_CXX_FOREIGN_REFERENCE_INPUTS_NULLABLE_H
#include <stdlib.h>
#include <new>
struct __attribute__((swift_attr("import_reference")))
__attribute__((swift_attr("retain:immortal")))
__attribute__((swift_attr("release:immortal"))) Empty {
int test() const { return 42; }
static Empty *create() { return new (malloc(sizeof(Empty))) Empty(); }
};
void mutateIt(Empty &) {}
struct __attribute__((swift_attr("import_reference")))
__attribute__((swift_attr("retain:immortal")))
__attribute__((swift_attr("release:immortal"))) IntPair {
int a = 1;
int b = 2;
int test() const { return b - a; }
static IntPair *create() { return new (malloc(sizeof(IntPair))) IntPair(); }
};
void mutateIt(IntPair *x) {
x->a = 2;
x->b = 4;
}
#endif // TEST_INTEROP_CXX_FOREIGN_REFERENCE_INPUTS_NULLABLE_H