Skip to content

Commit a9cb4fe

Browse files
Support 32-bit windows
1 parent 8cfc2e9 commit a9cb4fe

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/ITS/PropLibTemplate/proplib_loader.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"""
4444

4545
import platform
46+
import struct
4647
from ctypes import *
4748
from pathlib import Path
4849

@@ -71,7 +72,15 @@ def get_lib_name(lib_name: str) -> str:
7172
"""
7273
# Load the compiled library
7374
if platform.uname()[0] == "Windows":
74-
lib_name += ".dll"
75+
arch = struct.calcsize("P") * 8 # 32 or 64
76+
if arch == 64:
77+
lib_name += "-x64.dll"
78+
elif arch == 32:
79+
lib_name += "-x86.dll"
80+
else:
81+
raise RuntimeError(
82+
"Failed to determine system architecture for DLL loading"
83+
)
7584
elif platform.uname()[0] == "Linux":
7685
lib_name += ".so"
7786
elif platform.uname()[0] == "Darwin":

0 commit comments

Comments
 (0)