Fixed problem with type casting void* to int.

This commit is contained in:
crs 2003-04-13 18:14:01 +00:00
parent a4a08c3ce6
commit 019994548c
2 changed files with 10 additions and 8 deletions

View File

@ -246,16 +246,17 @@ realMain(void)
static static
void void
realMainEntry(void*) realMainEntry(void* vresult)
{ {
CThread::exit(reinterpret_cast<void*>(realMain())); *reinterpret_cast<int*>(vresult) = realMain();
} }
static static
int int
runMainInThread(void) runMainInThread(void)
{ {
CThread appThread(new CFunctionJob(&realMainEntry)); int result;
CThread appThread(new CFunctionJob(&realMainEntry, &result));
try { try {
#if WINDOWS_LIKE #if WINDOWS_LIKE
MSG msg; MSG msg;
@ -272,7 +273,7 @@ runMainInThread(void)
#else #else
appThread.wait(-1.0); appThread.wait(-1.0);
#endif #endif
return reinterpret_cast<int>(appThread.getResult()); return result;
} }
catch (XThread&) { catch (XThread&) {
appThread.cancel(); appThread.cancel();

View File

@ -268,16 +268,17 @@ realMain(void)
static static
void void
realMainEntry(void*) realMainEntry(void* vresult)
{ {
CThread::exit(reinterpret_cast<void*>(realMain())); *reinterpret_cast<int*>(vresult) = realMain();
} }
static static
int int
runMainInThread(void) runMainInThread(void)
{ {
CThread appThread(new CFunctionJob(&realMainEntry)); int result;
CThread appThread(new CFunctionJob(&realMainEntry, &result));
try { try {
#if WINDOWS_LIKE #if WINDOWS_LIKE
MSG msg; MSG msg;
@ -292,7 +293,7 @@ runMainInThread(void)
#else #else
appThread.wait(-1.0); appThread.wait(-1.0);
#endif #endif
return reinterpret_cast<int>(appThread.getResult()); return result;
} }
catch (XThread&) { catch (XThread&) {
appThread.cancel(); appThread.cancel();