Skip to content

Commit 3892551

Browse files
committed
C++: Fix binary incompatibility with freestanding build
`ImageCacheKey` has a different size depending on the feature `std` which is not reflected by cbindgen. Ensure that it is always the same for C++ build Fixes #10077 (Another option would have been to add "frature=std" in cbindgen::Config::defines, but the problem is that there is no SLINT_FEATURE_STD (it is SLINT_FEATURE_FREESTANDING and has the opposite meaning), and because of the order of includes it wouldn't be defined when then ImageCacheKey struct is declared)
1 parent b478a94 commit 3892551

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/core/graphics/image.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub struct StaticTextures {
289289
/// time of the file it points to.
290290
#[derive(PartialEq, Eq, Debug, Hash, Clone)]
291291
#[repr(C)]
292-
#[cfg(feature = "std")]
292+
#[cfg(any(feature = "std", feature = "ffi"))]
293293
pub struct CachedPath {
294294
path: SharedString,
295295
/// SystemTime since UNIX_EPOC as secs
@@ -318,7 +318,7 @@ pub enum ImageCacheKey {
318318
/// This variant indicates that no image cache key can be created for the image.
319319
/// For example this is the case for programmatically created images.
320320
Invalid = 0,
321-
#[cfg(feature = "std")]
321+
#[cfg(any(feature = "std", feature = "ffi"))]
322322
/// The image is identified by its path on the file system and the last modification time stamp.
323323
Path(CachedPath) = 1,
324324
/// The image is identified by a URL.

0 commit comments

Comments
 (0)