mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Fix item vtable usage on Windows
The item tree is intended to be initialized with pointers to the item vtables, which are implemented using data relocation records that resolve to the symbols exported by the sixtyfps_cpp shared library. On windows, according to https://docs.microsoft.com/en-us/cpp/c-language/rules-and-limitations-for-dllimport-dllexport?view=msvc-160 such data relocations are not supported, so this patch implements the fallback through getter functions.
This commit is contained in:
parent
4198513832
commit
28701d2f90
5 changed files with 30 additions and 5 deletions
|
@ -16,3 +16,15 @@ LICENSE END */
|
|||
#elif UINTPTR_MAX == 0xFFFFFFFFFFFFFFFFu
|
||||
# define SIXTYFPS_TARGET_64
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define SIXTYFPS_DLL_IMPORT __declspec(dllimport)
|
||||
#elif defined(__GNUC__)
|
||||
# if defined(_WIN32) || defined(_WIN64)
|
||||
# define SIXTYFPS_DLL_IMPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SIXTYFPS_DLL_IMPORT __attribute__((visibility("default")))
|
||||
# endif
|
||||
#else
|
||||
# define SIXTYFPS_DLL_IMPORT
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue