Changed enum names (collision with windows-defined macros), fixed thread call.

This commit is contained in:
Michael Jumper 2011-04-21 15:23:53 -07:00
parent bd8d314c29
commit 881d49278d
3 changed files with 24 additions and 20 deletions

View File

@ -83,21 +83,21 @@ typedef enum guac_composite_mode_t {
*/
/* ABCD */
/* NOT IMPL'D: 0000 */
RIN = 0x1, /* 0001 */
ROUT = 0x2, /* 0010 */
DEST = 0x3, /* 0011 */
IN = 0x4, /* 0100 */
GUAC_COMP_RIN = 0x1, /* 0001 */
GUAC_COMP_ROUT = 0x2, /* 0010 */
GUAC_COMP_DEST = 0x3, /* 0011 */
GUAC_COMP_IN = 0x4, /* 0100 */
/* NOT IMPL'D: 0101 */
ATOP = 0x6, /* 0110 */
GUAC_COMP_ATOP = 0x6, /* 0110 */
/* NOT IMPL'D: 0111 */
OUT = 0x8, /* 1000 */
RATOP = 0x9, /* 1001 */
XOR = 0xA, /* 1010 */
ROVER = 0xB, /* 1011 */
SRC = 0xC, /* 1100 */
GUAC_COMP_OUT = 0x8, /* 1000 */
GUAC_COMP_RATOP = 0x9, /* 1001 */
GUAC_COMP_XOR = 0xA, /* 1010 */
GUAC_COMP_ROVER = 0xB, /* 1011 */
GUAC_COMP_SRC = 0xC, /* 1100 */
/* NOT IMPL'D: 1101 */
OVER = 0xE, /* 1110 */
PLUS = 0xF /* 1111 */
GUAC_COMP_OVER = 0xE, /* 1110 */
GUAC_COMP_PLUS = 0xF /* 1111 */
} guac_composite_mode_t;

View File

@ -539,7 +539,7 @@ void guac_sleep(int millis) {
nanosleep(&sleep_period, NULL);
#elif defined(__MINGW32__)
Sleep(millis)
Sleep(millis);
#else
#warning No sleep/nanosleep function available. Clients may not perform as expected. Consider patching libguac to add support for your platform.
#endif

View File

@ -49,7 +49,11 @@ int guac_thread_create(guac_thread_t* thread, void*(*function)(void*), void* dat
return pthread_create(thread, NULL, function, data);
#elif defined(__MINGW32__)
*thread = _beginthreadex(NULL, 0,
function, data, 0 /* Create running */, NULL);
(unsigned(__stdcall*)(void*)) function, data,
0 /* Create running */, NULL);
if (thread == 0)
return errno;
return 0;
#endif
}
@ -57,7 +61,7 @@ void guac_thread_join(guac_thread_t thread) {
#ifdef HAVE_LIBPTHREAD
pthread_join(thread, NULL);
#elif defined(__MINGW32__)
WaitForSingleObject(thread, INFINITE);
WaitForSingleObject(&thread, INFINITE);
#endif
}