From fccb7f57a56f95da3e43eca67636bf0c3be068be Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 7 Apr 2024 11:34:42 +0900 Subject: [PATCH] Applied runtime process architecture bit-length on V4L2. --- FlashCap.Core/Internal/NativeMethods_V4L2.cs | 12 ++++++------ README.md | 12 ++++++------ README_ja.md | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) 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":