From aaa1d6a677e1ae4ecdab50f08be0976034a00aca Mon Sep 17 00:00:00 2001 From: aliasless Date: Mon, 18 Nov 2019 14:22:04 -0800 Subject: [PATCH] stepmania: fix runtime crash when built with new versions of gcc. Closes: #16630 [via git-merge-pr] --- srcpkgs/stepmania/patches/newgcc.patch | 36 ++++++++++++++++++++++++++ srcpkgs/stepmania/template | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/stepmania/patches/newgcc.patch diff --git a/srcpkgs/stepmania/patches/newgcc.patch b/srcpkgs/stepmania/patches/newgcc.patch new file mode 100644 index 00000000000..da23b59cc78 --- /dev/null +++ b/srcpkgs/stepmania/patches/newgcc.patch @@ -0,0 +1,36 @@ +Upstream: yes +https://github.com/stepmania/stepmania/commit/3f64564dd7c62a2f3d9557c1bdb8475fd953abea +--- src/MessageManager.cpp.orig ++++ src/MessageManager.cpp +@@ -207,8 +207,7 @@ void MessageManager::Unsubscribe( IMessageSubscriber* pSubscriber, MessageID m ) + + void MessageManager::Broadcast( Message &msg ) const + { +- // GAMESTATE is created before MESSAGEMAN, and has several BroadcastOnChangePtr members, so they all broadcast when they're initialized. +- if(this != NULL && m_Logging) ++ if(m_Logging) + { + LOG->Trace("MESSAGEMAN:Broadcast: %s", msg.GetName().c_str()); + } +--- src/StepMania.cpp.orig ++++ src/StepMania.cpp +@@ -1041,8 +1041,10 @@ int sm_main(int argc, char* argv[]) + // This needs PREFSMAN. + Dialog::Init(); + +- // Create game objects ++ // Set up the messaging system early to have well defined code. ++ MESSAGEMAN = new MessageManager; + ++ // Create game objects + GAMESTATE = new GameState; + + // This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. +@@ -1162,7 +1164,6 @@ int sm_main(int argc, char* argv[]) + SONGMAN->UpdatePopular(); + SONGMAN->UpdatePreferredSort(); + NSMAN = new NetworkSyncManager( pLoadingWindow ); +- MESSAGEMAN = new MessageManager; + STATSMAN = new StatsManager; + + // Initialize which courses are ranking courses here. diff --git a/srcpkgs/stepmania/template b/srcpkgs/stepmania/template index 4baeccb828d..07afdba93ce 100644 --- a/srcpkgs/stepmania/template +++ b/srcpkgs/stepmania/template @@ -1,7 +1,7 @@ # Template file for 'stepmania' pkgname=stepmania version=5.0.12 -revision=2 +revision=3 build_style=cmake make_cmd=make cmake_builddir="Build"