We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23dbe89 commit c55bd41Copy full SHA for c55bd41
1 file changed
tidesdb/tidesdb.py
@@ -51,12 +51,20 @@ def _load_library():
51
def _get_libc():
52
"""Get the C standard library for memory management operations."""
53
import sys
54
+ from ctypes.util import find_library
55
+
56
if sys.platform == 'win32':
57
return ctypes.cdll.msvcrt
- elif sys.platform == 'darwin':
- return ctypes.CDLL('libc.dylib')
58
else:
59
- return ctypes.CDLL('libc.so.6')
+ # Use find_library to locate the correct libc
60
+ libc_name = find_library('c')
61
+ if libc_name:
62
+ return ctypes.CDLL(libc_name)
63
+ # Fallback to platform-specific names
64
+ elif sys.platform == 'darwin':
65
+ return ctypes.CDLL('libc.dylib')
66
+ else:
67
+ return ctypes.CDLL('libc.so.6')
68
69
70
_libc = _get_libc()
0 commit comments