mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-23 20:12:39 +03:00
Fixed problem with type casting void* to int.
This commit is contained in:
parent
a4a08c3ce6
commit
019994548c
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user