Compatibility with Watcom's DLL exports for plugins

This commit is contained in:
z3APA3A 2016-12-10 03:56:11 +03:00
parent 88263ebde9
commit c650d32206
4 changed files with 22 additions and 34 deletions

View File

@ -100,17 +100,7 @@ int savecouters(void)
return (0); return (0);
} }
/*--------------------------------------------------------------------------*/
#ifdef _WIN32
__declspec(dllexport) int start(struct pluginlink * pluginlink,
int argc, char** argv);
#else
int start(struct pluginlink * pluginlink,
int argc, char** argv);
#endif
/* --------------------------------------------------------------------------*/ /* --------------------------------------------------------------------------*/
static int ldapfunc(struct clientparam *param) static int ldapfunc(struct clientparam *param)
@ -467,7 +457,15 @@ int h_dircount(int argc, unsigned char ** argv)
/*------------------------------- MAIN -------------------------------------- /*------------------------------- MAIN --------------------------------------
start plugin init */ start plugin init */
int start(struct pluginlink * pluginlink, int argc, char** argv) #ifdef _WIN32
__declspec(dllexport) int start(struct pluginlink * pluginlink,
int argc, char** argv)
#else
int start(struct pluginlink * pluginlink,
int argc, char** argv)
#endif
{ {

View File

@ -151,8 +151,6 @@ static int restore_old_table(void * v)
/*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/
#ifdef _WIN32 #ifdef _WIN32
__declspec(dllexport) int start(struct pluginlink * pluginlink,
int argc, char** argv);
BOOL WINAPI DllMain( HINSTANCE hModule, BOOL WINAPI DllMain( HINSTANCE hModule,
DWORD ul_reason_for_call, DWORD ul_reason_for_call,
LPVOID lpReserved LPVOID lpReserved
@ -165,17 +163,18 @@ BOOL WINAPI DllMain( HINSTANCE hModule,
} }
return TRUE; return TRUE;
} }
__declspec(dllexport) int start(struct pluginlink * pluginlink,
int argc, char** argv)
#else #else
int start(struct pluginlink * pluginlink, int start(struct pluginlink * pluginlink,
int argc, char** argv); int argc, char** argv)
#endif #endif
/*---------------------- start plugin init ------------------------------ */
int start(struct pluginlink * pluginlink, int argc, char** argv)
{ {
FILE *f=NULL; FILE *f=NULL;

View File

@ -15,10 +15,6 @@
extern "C" { extern "C" {
#endif #endif
__declspec(dllexport) int WindowsAuthentication(struct pluginlink * pluginlink,
int argc, char** argv);
static struct auth alwaysauth; static struct auth alwaysauth;
static char sidbuf[4096]; static char sidbuf[4096];
@ -62,12 +58,7 @@ extern "C" {
return 7; return 7;
} }
#ifdef __cplusplus __declspec(dllexport) int WindowsAuthentication(struct pluginlink * pluginlink, int argc, char** argv){
}
#endif
int WindowsAuthentication(struct pluginlink * pluginlink, int argc, char** argv){
char tmpbuf[4096]; char tmpbuf[4096];
DWORD dlen, sidlen; DWORD dlen, sidlen;
SID_NAME_USE snu; SID_NAME_USE snu;
@ -91,4 +82,7 @@ int WindowsAuthentication(struct pluginlink * pluginlink, int argc, char** argv)
return 0; return 0;
} }
#ifdef __cplusplus
}
#endif

View File

@ -14,9 +14,6 @@
extern "C" { extern "C" {
#endif #endif
__declspec(dllexport) int utf8tocp1251(struct pluginlink * pluginlink,
int argc, char** argv);
static struct auth alwaysauth; static struct auth alwaysauth;
@ -64,12 +61,9 @@ unsigned char * conv_utf8_to_cp1251(unsigned char *s){
return 4; return 4;
} }
#ifdef __cplusplus
}
#endif
int utf8tocp1251(struct pluginlink * pluginlink, int argc, char** argv){ __declspec(dllexport) int utf8tocp1251(struct pluginlink * pluginlink, int argc, char** argv){
static int loaded = 0; static int loaded = 0;
@ -85,4 +79,7 @@ int utf8tocp1251(struct pluginlink * pluginlink, int argc, char** argv){
} }
#ifdef __cplusplus
}
#endif