|
24 | 24 | _c_library_name = find_library("c") or "libc.so.6" |
25 | 25 |
|
26 | 26 | dll = ctypes.CDLL(_c_library_name) |
27 | | - |
| 27 | +mdll = dll if platform in ("win32", "cygwin") else ctypes.CDLL(find_library("m") or "libm.so.6") |
28 | 28 |
|
29 | 29 | class tm(ctypes.Structure): |
30 | 30 | _fields_ = [ |
@@ -136,20 +136,20 @@ class lconv(ctypes.Structure): |
136 | 136 | dll.localeconv.argtypes = () |
137 | 137 | dll.localeconv.restype = ctypes.POINTER(lconv) |
138 | 138 | # double frexp(double x, int* exponent) |
139 | | -dll.frexp.argtypes = ( |
| 139 | +mdll.frexp.argtypes = ( |
140 | 140 | ctypes.c_double, |
141 | 141 | ctypes.POINTER(ctypes.c_int), |
142 | 142 | ) |
143 | | -dll.frexp.restype = ctypes.c_double |
| 143 | +mdll.frexp.restype = ctypes.c_double |
144 | 144 | # double ldexp(double x, int exponent) |
145 | | -dll.ldexp.argtypes = (ctypes.c_double, ctypes.c_int) |
146 | | -dll.ldexp.restype = ctypes.c_double |
| 145 | +mdll.ldexp.argtypes = (ctypes.c_double, ctypes.c_int) |
| 146 | +mdll.ldexp.restype = ctypes.c_double |
147 | 147 | # double modf(double x, double* integer) |
148 | | -dll.modf.argtypes = ( |
| 148 | +mdll.modf.argtypes = ( |
149 | 149 | ctypes.c_double, |
150 | 150 | ctypes.POINTER(ctypes.c_double), |
151 | 151 | ) |
152 | | -dll.modf.restype = ctypes.c_double |
| 152 | +mdll.modf.restype = ctypes.c_double |
153 | 153 | # int raise(int sig) |
154 | 154 | c_raise.argtypes = (ctypes.c_int,) |
155 | 155 | c_raise.restype = ctypes.c_int |
|
0 commit comments