[ElmSharp] Fix elm_transit_paused_get to return boolean correctly (#2022)
authorjaehyun0cho <jaehyun0cho@gmail.com>
Thu, 17 Sep 2020 06:53:40 +0000 (15:53 +0900)
committerGitHub <noreply@github.com>
Thu, 17 Sep 2020 06:53:40 +0000 (15:53 +0900)
Interop.Elementary.elm_transit_paused_get always returns true although
elm_transit_paused_get actually returns EINA_FALSE.

Since C and C# use 4 bytes for boolean but C++ uses 1 byte for boolean,
this may cause that the boolean return value is not passed correctly.

To resolve this issue, [return: MarshalAs(UnmanagedType.U1)] is inserted
to the declaration of elm_transit_paused_get in Interop.Elementary.cs.

This patch refers 98c70851b1b1d640295768e6050c90ed61889e7c

Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
src/ElmSharp/Interop/Interop.Elementary.cs

index 675347e..015551d 100644 (file)
@@ -734,6 +734,7 @@ internal static partial class Interop
         internal static extern void elm_transit_paused_set(IntPtr transit, bool paused);
 
         [DllImport(Libraries.Elementary)]
+        [return : MarshalAs(UnmanagedType.U1)]
         internal static extern bool elm_transit_paused_get(IntPtr transit);
 
         [DllImport(Libraries.Elementary)]