Declare unified module interface and use it in modules

This fixes loading modules compiled with a C++ compiler. Remote thandle
type, it's unused. Use tintptr for module data. Don't cast pointers to
long, they won't fit on Win64.
This commit is contained in:
Pavel Roskin
2016-07-08 05:09:09 +00:00
parent 2c13ef5c6d
commit ace7d2c822
6 changed files with 39 additions and 21 deletions
+10 -1
View File
@@ -113,7 +113,6 @@ typedef __int64 tbus;
#else
typedef long tbus;
#endif
typedef tbus thandle;
typedef tbus tintptr;
/* wide char, socket */
#if defined(_WIN32)
@@ -137,4 +136,14 @@ typedef signed long long tsi64;
#define printflike(arg_format, arg_first_check)
#endif
/* module interface */
#ifdef __cplusplus
extern "C" {
#endif
tintptr mod_init();
int mod_exit(tintptr);
#ifdef __cplusplus
}
#endif
#endif