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

View File

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