Last active
July 30, 2018 09:05
-
-
Save LAK132/5c208dd769f8698ea78e3baecaf54cbc to your computer and use it in GitHub Desktop.
PY_EXPORT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import platform | |
from ctypes import cdll, CDLL | |
from ctypes import sizeof, c_void_p | |
def loadlibrary(name): | |
'''loads library "name[32/64/...][.dll/.so]" depending on platform''' | |
return CDLL((name+"{}{}").format(sizeof(c_void_p)*8, "" if platform=="win32" else ".so")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef PY_EXPORT | |
# if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) | |
# define PY_EXPORT extern "C" __declspec(dllexport) | |
# else | |
# define PY_EXPORT extern "C" | |
# endif | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment