File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -100,8 +100,8 @@ extern "C" {
100100 DLib_ModuleRef mod; \
101101 DLib_SymbolRef sym; \
102102 void * addr; \
103- long laddr; \
104- long lff; \
103+ DLib_Ptr laddr; \
104+ DLib_Ptr lff; \
105105 _ret_ ( * ff )( __VA_ARGS__ ); \
106106 \
107107 mod = DLib_GetModule( # _module_ ); \
@@ -110,9 +110,9 @@ extern "C" {
110110 if( sym != NULL ) \
111111 { \
112112 addr = DLib_Symbol_GetAddress( sym ); \
113- laddr = ( long )addr; \
113+ laddr = ( DLib_Ptr )addr; \
114114 ff = ( _ret_ ( * )( __VA_ARGS__ ) )laddr; \
115- lff = ( long )ff; \
115+ lff = ( DLib_Ptr )ff; \
116116 \
117117 DLIB_PRIVATE_ATOMIC_CAS_PTR( NULL, ( void * )lff, &f ); \
118118 } \
Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ typedef enum
4747}
4848DLib_ModuleType ;
4949
50+ #if defined( _WIN32 ) && defined( _WIN64 )
51+ typedef long long DLib_Ptr ; /* Windows x64 - LLP64 */
52+ #elif defined( _WIN32 )
53+ typedef int DLib_Ptr ; /* Windows x86 - ILP32 */
54+ #else
55+ typedef long DLib_Ptr ; /* OS X - LP64 or ILP32 */
56+ #endif
57+
5058#ifdef __cplusplus
5159}
5260#endif
Original file line number Diff line number Diff line change @@ -169,9 +169,6 @@ void __DLib_Module_Load( DLib_ModuleRef module )
169169
170170 if ( ws != NULL )
171171 {
172- /*
173- module->handle = LoadLibraryEx( ws, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS );
174- */
175172 module -> handle = LoadLibrary ( ws );
176173
177174 free ( ws );
You can’t perform that action at this time.
0 commit comments