Browse Source

Added assertions to flag when __FILE__ returns a relative path and fixed the LiveConstants demo

tags/2021-05-28
tpoole 8 years ago
parent
commit
c8740688ba
6 changed files with 24 additions and 3 deletions
  1. +2
    -0
      examples/Demo/Builds/VisualStudio2013/JuceDemo_App.vcxproj
  2. +2
    -0
      examples/Demo/Builds/VisualStudio2015/JuceDemo_App.vcxproj
  3. +2
    -0
      examples/Demo/Builds/VisualStudio2017/JuceDemo_App.vcxproj
  4. +4
    -3
      examples/Demo/JuceDemo.jucer
  5. +8
    -0
      modules/juce_events/messages/juce_ApplicationBase.cpp
  6. +6
    -0
      modules/juce_gui_extra/misc/juce_LiveConstantEditor.h

+ 2
- 0
examples/Demo/Builds/VisualStudio2013/JuceDemo_App.vcxproj View File

@@ -76,6 +76,7 @@
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/FC %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -117,6 +118,7 @@
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/FC %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>


+ 2
- 0
examples/Demo/Builds/VisualStudio2015/JuceDemo_App.vcxproj View File

@@ -78,6 +78,7 @@
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/FC %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -117,6 +118,7 @@
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/FC %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>


+ 2
- 0
examples/Demo/Builds/VisualStudio2017/JuceDemo_App.vcxproj View File

@@ -78,6 +78,7 @@
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/FC %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -117,6 +118,7 @@
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/FC %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>


+ 4
- 3
examples/Demo/JuceDemo.jucer View File

@@ -64,7 +64,7 @@
<MODULEPATH id="juce_box2d" path="../../modules"/> <MODULEPATH id="juce_box2d" path="../../modules"/>
</MODULEPATHS> </MODULEPATHS>
</XCODE_IPHONE> </XCODE_IPHONE>
<VS2013 targetFolder="Builds/VisualStudio2013" bigIcon="BvyE0d">
<VS2013 targetFolder="Builds/VisualStudio2013" bigIcon="BvyE0d" extraCompilerFlags="/FC">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit" <CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
isDebug="1" optimisation="1" targetName="JuceDemo"/> isDebug="1" optimisation="1" targetName="JuceDemo"/>
@@ -89,7 +89,7 @@
<MODULEPATH id="juce_audio_basics" path="../../modules"/> <MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS> </MODULEPATHS>
</VS2013> </VS2013>
<VS2015 targetFolder="Builds/VisualStudio2015" bigIcon="BvyE0d">
<VS2015 targetFolder="Builds/VisualStudio2015" bigIcon="BvyE0d" extraCompilerFlags="/FC">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="x64" <CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="x64"
isDebug="1" optimisation="1" targetName="JuceDemo"/> isDebug="1" optimisation="1" targetName="JuceDemo"/>
@@ -114,7 +114,8 @@
<MODULEPATH id="juce_audio_basics" path="../../modules"/> <MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS> </MODULEPATHS>
</VS2015> </VS2015>
<VS2017 targetFolder="Builds/VisualStudio2017" smallIcon="" bigIcon="BvyE0d">
<VS2017 targetFolder="Builds/VisualStudio2017" smallIcon="" bigIcon="BvyE0d"
extraCompilerFlags="/FC">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="x64" <CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="x64"
isDebug="1" optimisation="1" targetName="JuceDemo"/> isDebug="1" optimisation="1" targetName="JuceDemo"/>


+ 8
- 0
modules/juce_events/messages/juce_ApplicationBase.cpp View File

@@ -69,7 +69,15 @@ void JUCEApplicationBase::sendUnhandledException (const std::exception* const e,
const int lineNumber) const int lineNumber)
{ {
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance()) if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
{
// If you hit this assertion then the __FILE__ macro is providing a
// relative path instead of an absolute path. On Windows this will be
// a path relative to the build directory rather than the currently
// running application. To fix this you must compile with the /FC flag.
jassert (File::isAbsolutePath (sourceFile));
app->unhandledException (e, sourceFile, lineNumber); app->unhandledException (e, sourceFile, lineNumber);
}
} }
//============================================================================== //==============================================================================


+ 6
- 0
modules/juce_gui_extra/misc/juce_LiveConstantEditor.h View File

@@ -238,6 +238,12 @@ namespace LiveConstantEditor
template <typename Type> template <typename Type>
inline LiveValue<Type>& getValue (const char* file, int line, const Type& initialValue) inline LiveValue<Type>& getValue (const char* file, int line, const Type& initialValue)
{ {
// If you hit this assertion then the __FILE__ macro is providing a
// relative path instead of an absolute path. On Windows this will be
// a path relative to the build directory rather than the currently
// running application. To fix this you must compile with the /FC flag.
jassert (File::isAbsolutePath (file));
return ValueList::getInstance()->getValue (file, line, initialValue); return ValueList::getInstance()->getValue (file, line, initialValue);
} }


Loading…
Cancel
Save