diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/threads.cxx | 2 | ||||
| -rw-r--r-- | test/threads.h | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/test/threads.cxx b/test/threads.cxx index c7fecffb6..c07b2ea9f 100644 --- a/test/threads.cxx +++ b/test/threads.cxx @@ -41,7 +41,7 @@ void magic_number_cb(void *p) w->redraw_label(); } -void* prime_func(void* p) +extern "C" void* prime_func(void* p) { Fl_Browser* browser = (Fl_Browser*) p; Fl_Value_Output *value; diff --git a/test/threads.h b/test/threads.h index c3ebf0c72..73191459b 100644 --- a/test/threads.h +++ b/test/threads.h @@ -40,8 +40,11 @@ # include <pthread.h> typedef pthread_t Fl_Thread; +extern "C" { + typedef void *(Fl_Thread_Func)(void *); +} -static int fl_create_thread(Fl_Thread& t, void *(*f) (void *), void* p) { +static int fl_create_thread(Fl_Thread& t, Fl_Thread_Func* f, void* p) { return pthread_create((pthread_t*)&t, 0, f, p); } @@ -51,8 +54,11 @@ static int fl_create_thread(Fl_Thread& t, void *(*f) (void *), void* p) { # include <process.h> typedef unsigned long Fl_Thread; +extern "C" { + typedef void *(__cdecl Fl_Thread_Func)(void *); +} -static int fl_create_thread(Fl_Thread& t, void *(*f) (void *), void* p) { +static int fl_create_thread(Fl_Thread& t, Fl_Thread_Func* f, void* p) { return t = (Fl_Thread)_beginthread((void( __cdecl * )( void * ))f, 0, p); } @@ -60,8 +66,11 @@ static int fl_create_thread(Fl_Thread& t, void *(*f) (void *), void* p) { # include <process.h> typedef unsigned long Fl_Thread; +extern "C" { + typedef void *(__cdecl Fl_Thread_Func)(void *); +} -static int fl_create_thread(Fl_Thread& t, void *(*f) (void *), void* p) { +static int fl_create_thread(Fl_Thread& t, Fl_Thread_Func* f, void* p) { return t = (Fl_Thread)_beginthread((void(* )( void * ))f, 32000, p); } # endif // !HAVE_PTHREAD_H |
