Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid functions in _cstd.py #27

Merged
merged 3 commits into from
Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/pointers/_cstd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
_c_library_name = find_library("c") or "libc.so.6"

dll = ctypes.CDLL(_c_library_name)

mdll = dll if platform in ("win32", "cygwin") else ctypes.CDLL(find_library("m") or "libm.so.6")
USLTD marked this conversation as resolved.
Show resolved Hide resolved

class tm(ctypes.Structure):
_fields_ = [
Expand Down Expand Up @@ -136,20 +136,20 @@ class lconv(ctypes.Structure):
dll.localeconv.argtypes = ()
dll.localeconv.restype = ctypes.POINTER(lconv)
# double frexp(double x, int* exponent)
dll.frexp.argtypes = (
mdll.frexp.argtypes = (
ctypes.c_double,
ctypes.POINTER(ctypes.c_int),
)
dll.frexp.restype = ctypes.c_double
mdll.frexp.restype = ctypes.c_double
# double ldexp(double x, int exponent)
dll.ldexp.argtypes = (ctypes.c_double, ctypes.c_int)
dll.ldexp.restype = ctypes.c_double
mdll.ldexp.argtypes = (ctypes.c_double, ctypes.c_int)
mdll.ldexp.restype = ctypes.c_double
# double modf(double x, double* integer)
dll.modf.argtypes = (
mdll.modf.argtypes = (
ctypes.c_double,
ctypes.POINTER(ctypes.c_double),
)
dll.modf.restype = ctypes.c_double
mdll.modf.restype = ctypes.c_double
# int raise(int sig)
c_raise.argtypes = (ctypes.c_int,)
c_raise.restype = ctypes.c_int
Expand Down