Commit 0154c07d authored by deuce's avatar deuce
Browse files

Do the DLL im/ex-port dance.

parent 2aebfd81
...@@ -58,6 +58,8 @@ target_include_directories(ciolib PRIVATE "${XPDev_DIR}/../../../include/xpdev") ...@@ -58,6 +58,8 @@ target_include_directories(ciolib PRIVATE "${XPDev_DIR}/../../../include/xpdev")
target_compile_definitions(ciolib PRIVATE $<TARGET_PROPERTY:xpdev,INTERFACE_COMPILE_DEFINITIONS>) target_compile_definitions(ciolib PRIVATE $<TARGET_PROPERTY:xpdev,INTERFACE_COMPILE_DEFINITIONS>)
target_include_directories(ciolib PRIVATE $<TARGET_PROPERTY:xpdev,INTERFACE_INCLUDE_DIRECTORIES>) target_include_directories(ciolib PRIVATE $<TARGET_PROPERTY:xpdev,INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(ciolib xpdev) target_link_libraries(ciolib xpdev)
target_compile_definitions(ciolib PRIVATE CIOLIB_EXPORTS)
target_compile_definitions(ciolib INTERFACE CIOLIB_IMPORTS)
if(SDL_FOUND) if(SDL_FOUND)
target_include_directories(ciolib PRIVATE ${SDL_INCLUDE_DIR}) target_include_directories(ciolib PRIVATE ${SDL_INCLUDE_DIR})
......
...@@ -493,18 +493,18 @@ extern int ciolib_mouse_initialized; ...@@ -493,18 +493,18 @@ extern int ciolib_mouse_initialized;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void ciomouse_gotevent(int event, int x, int y); CIOLIBEXPORT void CIOLIBCALL ciomouse_gotevent(int event, int x, int y);
int mouse_trywait(void); CIOLIBEXPORT int CIOLIBCALL mouse_trywait(void);
int mouse_wait(void); CIOLIBEXPORT int CIOLIBCALL mouse_wait(void);
int mouse_pending(void); CIOLIBEXPORT int CIOLIBCALL mouse_pending(void);
int ciolib_getmouse(struct mouse_event *mevent); CIOLIBEXPORT int CIOLIBCALL ciolib_getmouse(struct mouse_event *mevent);
int ciolib_ungetmouse(struct mouse_event *mevent); CIOLIBEXPORT int CIOLIBCALL ciolib_ungetmouse(struct mouse_event *mevent);
void ciolib_mouse_thread(void *data); CIOLIBEXPORT void CIOLIBCALL ciolib_mouse_thread(void *data);
int ciomouse_setevents(int events); CIOLIBEXPORT int CIOLIBCALL ciomouse_setevents(int events);
int ciomouse_addevents(int events); CIOLIBEXPORT int CIOLIBCALL ciomouse_addevents(int events);
int ciomouse_delevents(int events); CIOLIBEXPORT int CIOLIBCALL ciomouse_delevents(int events);
int ciomouse_addevent(int event); CIOLIBEXPORT int CIOLIBCALL ciomouse_addevent(int event);
int ciomouse_delevent(int event); CIOLIBEXPORT int CIOLIBCALL ciomouse_delevent(int event);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -100,7 +100,7 @@ int ciolib_mouse_initialized=0; ...@@ -100,7 +100,7 @@ int ciolib_mouse_initialized=0;
static int ungot=0; static int ungot=0;
pthread_mutex_t unget_mutex; pthread_mutex_t unget_mutex;
void init_mouse(void) void CIOLIBCALL init_mouse(void)
{ {
memset(&state,0,sizeof(state)); memset(&state,0,sizeof(state));
state.click_timeout=0; state.click_timeout=0;
...@@ -111,37 +111,37 @@ void init_mouse(void) ...@@ -111,37 +111,37 @@ void init_mouse(void)
ciolib_mouse_initialized=1; ciolib_mouse_initialized=1;
} }
int ciomouse_setevents(int events) int CIOLIBCALL ciomouse_setevents(int events)
{ {
mouse_events=events; mouse_events=events;
return mouse_events; return mouse_events;
} }
int ciomouse_addevents(int events) int CIOLIBCALL ciomouse_addevents(int events)
{ {
mouse_events |= events; mouse_events |= events;
return mouse_events; return mouse_events;
} }
int ciomouse_delevents(int events) int CIOLIBCALL ciomouse_delevents(int events)
{ {
mouse_events &= ~events; mouse_events &= ~events;
return mouse_events; return mouse_events;
} }
int ciomouse_addevent(int event) int CIOLIBCALL ciomouse_addevent(int event)
{ {
mouse_events |= (1<<event); mouse_events |= (1<<event);
return mouse_events; return mouse_events;
} }
int ciomouse_delevent(int event) int CIOLIBCALL ciomouse_delevent(int event)
{ {
mouse_events &= ~(1<<event); mouse_events &= ~(1<<event);
return mouse_events; return mouse_events;
} }
void ciomouse_gotevent(int event, int x, int y) void CIOLIBCALL ciomouse_gotevent(int event, int x, int y)
{ {
struct in_mouse_event *ime; struct in_mouse_event *ime;
...@@ -157,7 +157,7 @@ void ciomouse_gotevent(int event, int x, int y) ...@@ -157,7 +157,7 @@ void ciomouse_gotevent(int event, int x, int y)
listPushNode(&state.input,ime); listPushNode(&state.input,ime);
} }
void add_outevent(int event, int x, int y) void CIOLIBCALL add_outevent(int event, int x, int y)
{ {
struct out_mouse_event *ome; struct out_mouse_event *ome;
int but; int but;
...@@ -179,7 +179,7 @@ void add_outevent(int event, int x, int y) ...@@ -179,7 +179,7 @@ void add_outevent(int event, int x, int y)
listPushNode(&state.output,ome); listPushNode(&state.output,ome);
} }
int more_multies(int button, int clicks) int CIOLIBCALL more_multies(int button, int clicks)
{ {
switch(clicks) { switch(clicks) {
case 0: case 0:
...@@ -198,7 +198,7 @@ int more_multies(int button, int clicks) ...@@ -198,7 +198,7 @@ int more_multies(int button, int clicks)
return(0); return(0);
} }
void ciolib_mouse_thread(void *data) void CIOLIBCALL ciolib_mouse_thread(void *data)
{ {
int timedout; int timedout;
int timeout_button=0; int timeout_button=0;
...@@ -431,7 +431,7 @@ void ciolib_mouse_thread(void *data) ...@@ -431,7 +431,7 @@ void ciolib_mouse_thread(void *data)
} }
} }
int mouse_trywait(void) int CIOLIBCALL mouse_trywait(void)
{ {
int result; int result;
...@@ -449,7 +449,7 @@ int mouse_trywait(void) ...@@ -449,7 +449,7 @@ int mouse_trywait(void)
} }
} }
int mouse_wait(void) int CIOLIBCALL mouse_wait(void)
{ {
int result; int result;
...@@ -467,14 +467,14 @@ int mouse_wait(void) ...@@ -467,14 +467,14 @@ int mouse_wait(void)
} }
} }
int mouse_pending(void) int CIOLIBCALL mouse_pending(void)
{ {
while(!ciolib_mouse_initialized) while(!ciolib_mouse_initialized)
SLEEP(1); SLEEP(1);
return(listCountNodes(&state.output)); return(listCountNodes(&state.output));
} }
int ciolib_getmouse(struct mouse_event *mevent) int CIOLIBCALL ciolib_getmouse(struct mouse_event *mevent)
{ {
int retval=0; int retval=0;
...@@ -505,7 +505,7 @@ int ciolib_getmouse(struct mouse_event *mevent) ...@@ -505,7 +505,7 @@ int ciolib_getmouse(struct mouse_event *mevent)
return(retval); return(retval);
} }
int ciolib_ungetmouse(struct mouse_event *mevent) int CIOLIBCALL ciolib_ungetmouse(struct mouse_event *mevent)
{ {
struct mouse_event *me; struct mouse_event *me;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment