From 687da26536540dbe14c171b4eddb35c68fd13293 Mon Sep 17 00:00:00 2001 From: "duncan%be.com" Date: Wed, 17 Nov 1999 15:18:02 +0000 Subject: [PATCH] BeOS only fixes to keep Mozilla building on BeOS. Still doesn't really run. --- config/beos/checklib.sh | 2 +- widget/src/beos/nsAppShell.cpp | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/config/beos/checklib.sh b/config/beos/checklib.sh index 497a05b29a51..6577a173cbd8 100644 --- a/config/beos/checklib.sh +++ b/config/beos/checklib.sh @@ -46,7 +46,7 @@ fi # generate stub -echo "stub(){return(0);}">${libname}.c +echo "int stub(){return(0);}">${libname}.c c++ -nostart ${libname}.c -olib${libname}.so rm ${libname}.c diff --git a/widget/src/beos/nsAppShell.cpp b/widget/src/beos/nsAppShell.cpp index f15370008012..45dcf72b270e 100644 --- a/widget/src/beos/nsAppShell.cpp +++ b/widget/src/beos/nsAppShell.cpp @@ -33,6 +33,8 @@ #include #include +static int gBAppCount = 0; + struct ThreadInterfaceData { void *data; @@ -118,10 +120,13 @@ nsAppShell::nsAppShell() NS_INIT_REFCNT(); mDispatchListener = 0; - sem_id initsem = create_sem(0, "bapp init"); - resume_thread(spawn_thread(bapp_thread, "BApplication", B_NORMAL_PRIORITY, (void *)initsem)); - acquire_sem(initsem); - delete_sem(initsem); + if(gBAppCount++ == 0) + { + sem_id initsem = create_sem(0, "bapp init"); + resume_thread(spawn_thread(bapp_thread, "BApplication", B_NORMAL_PRIORITY, (void *)initsem)); + acquire_sem(initsem); + delete_sem(initsem); + } } @@ -238,8 +243,11 @@ NS_METHOD nsAppShell::Exit() //------------------------------------------------------------------------- nsAppShell::~nsAppShell() { - if(be_app->Lock()) - be_app->Quit(); + if(--gBAppCount == 0) + { + if(be_app->Lock()) + be_app->Quit(); + } } //------------------------------------------------------------------------- @@ -277,6 +285,7 @@ NS_METHOD nsAppShell::Spindown() NS_METHOD nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent) { + aRealEvent = PR_FALSE; printf("nsAppShell::GetNativeEvent - FIXME: not implemented\n"); return NS_OK; }