Skip to content

Commit fccb7f5

Browse files
committed
Applied runtime process architecture bit-length on V4L2.
1 parent 76df4ad commit fccb7f5

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

FlashCap.Core/Internal/NativeMethods_V4L2.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ static NativeMethods_V4L2()
4040
{
4141
case "x86_64":
4242
case "amd64":
43-
Interop = new NativeMethods_V4L2_Interop_x86_64();
44-
break;
4543
case "i686":
4644
case "i586":
4745
case "i486":
4846
case "i386":
49-
Interop = new NativeMethods_V4L2_Interop_i686();
47+
Interop = IntPtr.Size == 8 ?
48+
new NativeMethods_V4L2_Interop_x86_64() :
49+
new NativeMethods_V4L2_Interop_i686();
5050
break;
5151
case "aarch64":
52-
Interop = new NativeMethods_V4L2_Interop_aarch64();
53-
break;
5452
case "armv9l":
5553
case "armv8l":
5654
case "armv7l":
5755
case "armv6l":
58-
Interop = new NativeMethods_V4L2_Interop_armv7l();
56+
Interop = IntPtr.Size == 8 ?
57+
new NativeMethods_V4L2_Interop_aarch64() :
58+
new NativeMethods_V4L2_Interop_armv7l();
5959
break;
6060
case "mips":
6161
case "mipsel":

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -748,22 +748,22 @@ switch (buf.machine)
748748
{
749749
case "x86_64":
750750
case "amd64":
751-
Interop = new NativeMethods_V4L2_Interop_x86_64();
752-
break;
753751
case "i686":
754752
case "i586":
755753
case "i486":
756754
case "i386":
757-
Interop = new NativeMethods_V4L2_Interop_i686();
755+
Interop = IntPtr.Size == 8 ?
756+
new NativeMethods_V4L2_Interop_x86_64() :
757+
new NativeMethods_V4L2_Interop_i686();
758758
break;
759759
case "aarch64":
760-
Interop = new NativeMethods_V4L2_Interop_aarch64();
761-
break;
762760
case "armv9l":
763761
case "armv8l":
764762
case "armv7l":
765763
case "armv6l":
766-
Interop = new NativeMethods_V4L2_Interop_armv7l();
764+
Interop = IntPtr.Size == 8 ?
765+
new NativeMethods_V4L2_Interop_aarch64() :
766+
new NativeMethods_V4L2_Interop_armv7l();
767767
break;
768768
case "mips":
769769
case "mipsel":

README_ja.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -683,22 +683,22 @@ switch (buf.machine)
683683
{
684684
case "x86_64":
685685
case "amd64":
686-
Interop = new NativeMethods_V4L2_Interop_x86_64();
687-
break;
688686
case "i686":
689687
case "i586":
690688
case "i486":
691689
case "i386":
692-
Interop = new NativeMethods_V4L2_Interop_i686();
690+
Interop = IntPtr.Size == 8 ?
691+
new NativeMethods_V4L2_Interop_x86_64() :
692+
new NativeMethods_V4L2_Interop_i686();
693693
break;
694694
case "aarch64":
695-
Interop = new NativeMethods_V4L2_Interop_aarch64();
696-
break;
697695
case "armv9l":
698696
case "armv8l":
699697
case "armv7l":
700698
case "armv6l":
701-
Interop = new NativeMethods_V4L2_Interop_armv7l();
699+
Interop = IntPtr.Size == 8 ?
700+
new NativeMethods_V4L2_Interop_aarch64() :
701+
new NativeMethods_V4L2_Interop_armv7l();
702702
break;
703703
case "mips":
704704
case "mipsel":

0 commit comments

Comments
 (0)