diff --git a/FlashCap.Core/Internal/NativeMethods_V4L2.cs b/FlashCap.Core/Internal/NativeMethods_V4L2.cs index 5448f69..7722ce9 100644 --- a/FlashCap.Core/Internal/NativeMethods_V4L2.cs +++ b/FlashCap.Core/Internal/NativeMethods_V4L2.cs @@ -40,22 +40,22 @@ static NativeMethods_V4L2() { case "x86_64": case "amd64": - Interop = new NativeMethods_V4L2_Interop_x86_64(); - break; case "i686": case "i586": case "i486": case "i386": - Interop = new NativeMethods_V4L2_Interop_i686(); + Interop = IntPtr.Size == 8 ? + new NativeMethods_V4L2_Interop_x86_64() : + new NativeMethods_V4L2_Interop_i686(); break; case "aarch64": - Interop = new NativeMethods_V4L2_Interop_aarch64(); - break; case "armv9l": case "armv8l": case "armv7l": case "armv6l": - Interop = new NativeMethods_V4L2_Interop_armv7l(); + Interop = IntPtr.Size == 8 ? + new NativeMethods_V4L2_Interop_aarch64() : + new NativeMethods_V4L2_Interop_armv7l(); break; case "mips": case "mipsel": diff --git a/README.md b/README.md index 07b1717..d3beadd 100644 --- a/README.md +++ b/README.md @@ -748,22 +748,22 @@ switch (buf.machine) { case "x86_64": case "amd64": - Interop = new NativeMethods_V4L2_Interop_x86_64(); - break; case "i686": case "i586": case "i486": case "i386": - Interop = new NativeMethods_V4L2_Interop_i686(); + Interop = IntPtr.Size == 8 ? + new NativeMethods_V4L2_Interop_x86_64() : + new NativeMethods_V4L2_Interop_i686(); break; case "aarch64": - Interop = new NativeMethods_V4L2_Interop_aarch64(); - break; case "armv9l": case "armv8l": case "armv7l": case "armv6l": - Interop = new NativeMethods_V4L2_Interop_armv7l(); + Interop = IntPtr.Size == 8 ? + new NativeMethods_V4L2_Interop_aarch64() : + new NativeMethods_V4L2_Interop_armv7l(); break; case "mips": case "mipsel": diff --git a/README_ja.md b/README_ja.md index 48db578..1a0c64c 100644 --- a/README_ja.md +++ b/README_ja.md @@ -683,22 +683,22 @@ switch (buf.machine) { case "x86_64": case "amd64": - Interop = new NativeMethods_V4L2_Interop_x86_64(); - break; case "i686": case "i586": case "i486": case "i386": - Interop = new NativeMethods_V4L2_Interop_i686(); + Interop = IntPtr.Size == 8 ? + new NativeMethods_V4L2_Interop_x86_64() : + new NativeMethods_V4L2_Interop_i686(); break; case "aarch64": - Interop = new NativeMethods_V4L2_Interop_aarch64(); - break; case "armv9l": case "armv8l": case "armv7l": case "armv6l": - Interop = new NativeMethods_V4L2_Interop_armv7l(); + Interop = IntPtr.Size == 8 ? + new NativeMethods_V4L2_Interop_aarch64() : + new NativeMethods_V4L2_Interop_armv7l(); break; case "mips": case "mipsel":