mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Update vendored windows libs
This commit is contained in:
parent
f61c211655
commit
b1cefa94e5
226 changed files with 33472 additions and 11882 deletions
21
libs/win/bugs/multi_os_libc.py
Normal file
21
libs/win/bugs/multi_os_libc.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from ctypes import CDLL, c_char_p
|
||||
|
||||
|
||||
def get_libc():
|
||||
libnames = ('msvcrt', 'libc.so.6')
|
||||
for libname in libnames:
|
||||
try:
|
||||
return CDLL(libname)
|
||||
except WindowsError:
|
||||
pass
|
||||
except OSError:
|
||||
pass
|
||||
raise RuntimeError("Unable to find a suitable libc (tried %s)" % libnames)
|
||||
|
||||
|
||||
getenv = get_libc().getenv
|
||||
getenv.restype = c_char_p
|
||||
|
||||
# call into your linked module here
|
||||
|
||||
print('new value is', getenv('FOO'))
|
Loading…
Add table
Add a link
Reference in a new issue