Skip to content

Commit c55bd41

Browse files
committed
minor corrections, additions
1 parent 23dbe89 commit c55bd41

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

tidesdb/tidesdb.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,20 @@ def _load_library():
5151
def _get_libc():
5252
"""Get the C standard library for memory management operations."""
5353
import sys
54+
from ctypes.util import find_library
55+
5456
if sys.platform == 'win32':
5557
return ctypes.cdll.msvcrt
56-
elif sys.platform == 'darwin':
57-
return ctypes.CDLL('libc.dylib')
5858
else:
59-
return ctypes.CDLL('libc.so.6')
59+
# 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')
6068

6169

6270
_libc = _get_libc()

0 commit comments

Comments
 (0)