From e9867a80b40c60fb29413e167bc44875a53956c6 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 10 Apr 2005 23:16:12 +0000 Subject: [PATCH] Don't assume that all files are c++. Remove the unnecessary objective-c++. --- .../stepmania.pbproj/project.pbxproj | 25 ++++++++--- .../arch/LoadingWindow/LoadingWindow_Cocoa.h | 9 ++-- ...gWindow_Cocoa.mm => LoadingWindow_Cocoa.m} | 2 +- stepmania/src/archutils/Darwin/Crash.h | 7 ++- stepmania/src/archutils/Darwin/Crash.m | 44 +++++++++++++++++++ stepmania/src/archutils/Darwin/StepMania.pch | 13 +++--- 6 files changed, 82 insertions(+), 18 deletions(-) rename stepmania/src/arch/LoadingWindow/{LoadingWindow_Cocoa.mm => LoadingWindow_Cocoa.m} (99%) create mode 100644 stepmania/src/archutils/Darwin/Crash.m diff --git a/stepmania/PBProject/stepmania.pbproj/project.pbxproj b/stepmania/PBProject/stepmania.pbproj/project.pbxproj index 19827040fd..8567258b35 100755 --- a/stepmania/PBProject/stepmania.pbproj/project.pbxproj +++ b/stepmania/PBProject/stepmania.pbproj/project.pbxproj @@ -250,6 +250,7 @@ 4A9504CDFFE6A4B311CA0CBA = { buildSettings = { COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = 3; @@ -1929,7 +1930,7 @@ GCC_ALTIVEC_EXTENSIONS = NO; GCC_ENABLE_CPP_RTTI = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_INPUT_FILETYPE = sourcecode.cpp.cpp; + GCC_INPUT_FILETYPE = automatic; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 3; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5322,7 +5323,6 @@ fileRef = AAEF3D0D04B533CC00D02EE9; isa = PBXBuildFile; settings = { - COMPILER_FLAGS = "-x objective-c++"; }; }; AA29CE090558741A00961A51 = { @@ -8671,6 +8671,7 @@ children = ( AAEF3D1004B53E2900D02EE9, AAEF3D0C04B533CC00D02EE9, + AA71446E0809E1A700545684, AAEF3D0D04B533CC00D02EE9, AA80C71A07F2069F00C99272, ); @@ -12185,6 +12186,17 @@ settings = { }; }; + AA71446E0809E1A700545684 = { + explicitFileType = sourcecode.cpp.objcpp; + fileEncoding = 4; + indentWidth = 4; + isa = PBXFileReference; + path = LoadingWindow_Cocoa.mm; + refType = 4; + sourceTree = ""; + tabWidth = 4; + usesTabs = 1; + }; AA729C420599B50D00779F33 = { explicitFileType = sourcecode.cpp; fileEncoding = 30; @@ -15134,10 +15146,10 @@ }; }; AACA591707B5DB1700763545 = { - explicitFileType = sourcecode.cpp; + explicitFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; - path = Crash.mm; + path = Crash.m; refType = 4; sourceTree = ""; }; @@ -15145,7 +15157,6 @@ fileRef = AACA591707B5DB1700763545; isa = PBXBuildFile; settings = { - COMPILER_FLAGS = "-x objective-c++"; }; }; AACA592407B5E1E500763545 = { @@ -16487,11 +16498,11 @@ usesTabs = 1; }; AAEF3D0D04B533CC00D02EE9 = { - explicitFileType = sourcecode.cpp.objcpp; + explicitFileType = sourcecode.c.objc; fileEncoding = 4; indentWidth = 4; isa = PBXFileReference; - path = LoadingWindow_Cocoa.mm; + path = LoadingWindow_Cocoa.m; refType = 4; sourceTree = ""; tabWidth = 4; diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h index 435db0cdcd..c16726e5b9 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h @@ -5,9 +5,12 @@ #include "LoadingWindow.h" -extern void MakeNewCocoaWindow(); -extern void DisposeOfCocoaWindow(); -extern void SetCocoaWindowText(const char *s); +extern "C" +{ + extern void MakeNewCocoaWindow(); + extern void DisposeOfCocoaWindow(); + extern void SetCocoaWindowText(const char *s); +} class LoadingWindow_Cocoa : public LoadingWindow { diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.mm b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.m similarity index 99% rename from stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.mm rename to stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.m index 147e53f34a..3374227553 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.mm +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.m @@ -1,5 +1,5 @@ #import -#include "ProductInfo.h" +#import "ProductInfo.h" static NSWindow *window; static NSTextView *text; diff --git a/stepmania/src/archutils/Darwin/Crash.h b/stepmania/src/archutils/Darwin/Crash.h index d72912da35..4ea2539bae 100644 --- a/stepmania/src/archutils/Darwin/Crash.h +++ b/stepmania/src/archutils/Darwin/Crash.h @@ -1,12 +1,15 @@ #ifndef DARWIN_CRASH_H #define DARWIN_CRASH_H -void InformUserOfCrash( const CString &sPath ); +extern "C" +{ + extern void InformUserOfCrash( const char *sPath ); +} #endif /* DARWIN_CRASH_H */ /* - * (c) 2003-2004 Steve Checkoway + * (c) 2003-2005 Steve Checkoway * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/stepmania/src/archutils/Darwin/Crash.m b/stepmania/src/archutils/Darwin/Crash.m new file mode 100644 index 0000000000..e317eb1fa8 --- /dev/null +++ b/stepmania/src/archutils/Darwin/Crash.m @@ -0,0 +1,44 @@ +#import + +void InformUserOfCrash( const char *sPath ) +{ + int ret = NSRunAlertPanel(@"StepMania has crashed", + @"StepMania has crashed. Debugging information " + @"has been output to\n\n%s\n\nPlease file a bug " + @"report at\n\nhttp://sf.net/tracker/?func=add&" + @"group_id=37892&atid=421366", + @"Open crashinfo.txt", @"Quit", nil, sPath); + + if( ret == NSAlertDefaultReturn ) + { + NSWorkspace *ws = [NSWorkspace sharedWorkspace]; + + [ws openFile:[NSString stringWithUTF8String:sPath]]; + } +} + +/* + * (c) 2003-2005 Steve Checkoway + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + \ No newline at end of file diff --git a/stepmania/src/archutils/Darwin/StepMania.pch b/stepmania/src/archutils/Darwin/StepMania.pch index 13e86407be..17fc34f077 100644 --- a/stepmania/src/archutils/Darwin/StepMania.pch +++ b/stepmania/src/archutils/Darwin/StepMania.pch @@ -1,8 +1,11 @@ /* Override the -DSM_PCH=TRUE temporarily. */ #undef SM_PCH #define SM_PCH FALSE -#include "global.h" -/* - * I can't decide if RageUtil.h should go here or not. It is used by 200 .cpp - * files out of 430 that are in src and subdirs. - */ +// Only do this for c++ files. +#ifdef __cplusplus +# include "global.h" +#endif + +#ifdef __OBJC__ +# import +#endif