mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
Using ctypes.WinDLL on Windows
This commit is contained in:
1 parent
7d5eb279a7
commit
22b430deb2
1 file changed
+4
-2
@@ -118,8 +118,10 @@ class Mongoose(object):
|
|||||||
"""A wrapper class for Mongoose shared library."""
|
"""A wrapper class for Mongoose shared library."""
|
||||||
|
|
||||||
def __init__(self, callback, **kwargs):
|
def __init__(self, callback, **kwargs):
|
||||||
dll_extension = os.name == 'nt' and 'dll' or 'so'
|
if os.name == 'nt':
|
||||||
self.dll = ctypes.CDLL('_mongoose.%s' % dll_extension)
|
self.dll = ctypes.WinDLL('_mongoose.dll')
|
||||||
|
else:
|
||||||
|
self.dll = ctypes.CDLL('_mongoose.so')
|
||||||
|
|
||||||
self.dll.mg_start.restype = ctypes.c_void_p
|
self.dll.mg_start.restype = ctypes.c_void_p
|
||||||
self.dll.mg_modify_passwords_file.restype = ctypes.c_int
|
self.dll.mg_modify_passwords_file.restype = ctypes.c_int
|
||||||
|
|||||||
Reference in new issue
Block a user