From 942999ea317557e172df986904c93c1c96879aa0 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Tue, 6 Jul 2010 10:24:06 +0100 Subject: [PATCH] Fix for xcode linker warnings when using the static lib. Tweaks to iPhone audio and StretchableLayoutManager. --- Builds/MacOSX/Juce.xcodeproj/project.pbxproj | 6 ++++-- Builds/iPhone/Juce.xcodeproj/project.pbxproj | 6 ++++-- .../Source/Project/jucer_ProjectExport_XCode.h | 12 +++++++++++- juce_amalgamated.cpp | 12 +++++++----- juce_amalgamated.h | 2 +- src/core/juce_StandardHeader.h | 2 +- .../layout/juce_StretchableLayoutManager.cpp | 8 ++++---- src/native/mac/juce_iphone_Audio.cpp | 4 +++- 8 files changed, 35 insertions(+), 17 deletions(-) diff --git a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj index ebe1f3851a..67e233ff64 100644 --- a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj @@ -1820,7 +1820,8 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_MODEL_TUNING = G5; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; ZERO_LINK = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; PRODUCT_NAME = "jucedebug"; }; name = Debug; }; @@ -1834,7 +1835,8 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_MODEL_TUNING = G5; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; ZERO_LINK = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; PRODUCT_NAME = "juce"; }; name = Release; }; diff --git a/Builds/iPhone/Juce.xcodeproj/project.pbxproj b/Builds/iPhone/Juce.xcodeproj/project.pbxproj index ad213a3423..f15e457e0b 100644 --- a/Builds/iPhone/Juce.xcodeproj/project.pbxproj +++ b/Builds/iPhone/Juce.xcodeproj/project.pbxproj @@ -1820,7 +1820,8 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_MODEL_TUNING = G5; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; ZERO_LINK = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; PRODUCT_NAME = "jucedebug"; }; name = Debug; }; @@ -1834,7 +1835,8 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_MODEL_TUNING = G5; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; ZERO_LINK = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; PRODUCT_NAME = "juce"; }; name = Release; }; diff --git a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h index f5970fa9bf..3e0478ea3c 100644 --- a/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h +++ b/extras/Jucer (experimental)/Source/Project/jucer_ProjectExport_XCode.h @@ -494,7 +494,17 @@ private: s.add ("GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES"); s.add ("GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES"); s.add ("GCC_MODEL_TUNING = G5"); - s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = YES"); + + if (project.isLibrary() || project.getJuceLinkageMode() == Project::useLinkedJuce) + { + s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = NO"); + s.add ("GCC_SYMBOLS_PRIVATE_EXTERN = NO"); + } + else + { + s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = YES"); + } + s.add ("ZERO_LINK = NO"); s.add ("DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\""); s.add ("PRODUCT_NAME = \"" + config.getTargetBinaryName().toString() + "\""); diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index adb9a8b447..9c0de2580b 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -62478,8 +62478,8 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, layout->currentSize = sizeToRealSize (layout->minSize, totalSize); totalMinimums += layout->currentSize; - totalIdealSize += sizeToRealSize (layout->preferredSize, availableSpace); - } + totalIdealSize += sizeToRealSize (layout->preferredSize, totalSize); + } if (totalIdealSize <= 0) totalIdealSize = 1.0; @@ -62497,7 +62497,7 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, { ItemLayoutProperties* const layout = items.getUnchecked (i); - double sizeWanted = sizeToRealSize (layout->preferredSize, availableSpace); + double sizeWanted = sizeToRealSize (layout->preferredSize, totalSize); const int bestSize = jlimit (layout->currentSize, jmax (layout->currentSize, @@ -62513,7 +62513,7 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, { ItemLayoutProperties* const layout = items.getUnchecked (i); - double sizeWanted = sizeToRealSize (layout->preferredSize, availableSpace); + double sizeWanted = sizeToRealSize (layout->preferredSize, totalSize); int bestSize = jlimit (layout->currentSize, jmax (layout->currentSize, sizeToRealSize (layout->maxSize, totalSize)), @@ -267658,7 +267658,9 @@ public: AudioSessionSetActive (true); - UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord; + UInt32 audioCategory = audioInputIsAvailable ? kAudioSessionCategory_PlayAndRecord + : kAudioSessionCategory_MediaPlayback; + AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (audioCategory), &audioCategory); AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange, propertyChangedStatic, this); diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 6d3ee6f15e..b3add5bd38 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -64,7 +64,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 52 -#define JUCE_BUILDNUMBER 35 +#define JUCE_BUILDNUMBER 36 /** Current Juce version number. diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index 934b1679ce..3769c6a572 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 52 -#define JUCE_BUILDNUMBER 35 +#define JUCE_BUILDNUMBER 36 /** Current Juce version number. diff --git a/src/gui/components/layout/juce_StretchableLayoutManager.cpp b/src/gui/components/layout/juce_StretchableLayoutManager.cpp index 5d8a0d0db6..20a980bf39 100644 --- a/src/gui/components/layout/juce_StretchableLayoutManager.cpp +++ b/src/gui/components/layout/juce_StretchableLayoutManager.cpp @@ -251,8 +251,8 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, layout->currentSize = sizeToRealSize (layout->minSize, totalSize); totalMinimums += layout->currentSize; - totalIdealSize += sizeToRealSize (layout->preferredSize, availableSpace); - } + totalIdealSize += sizeToRealSize (layout->preferredSize, totalSize); + } if (totalIdealSize <= 0) totalIdealSize = 1.0; @@ -270,7 +270,7 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, { ItemLayoutProperties* const layout = items.getUnchecked (i); - double sizeWanted = sizeToRealSize (layout->preferredSize, availableSpace); + double sizeWanted = sizeToRealSize (layout->preferredSize, totalSize); const int bestSize = jlimit (layout->currentSize, jmax (layout->currentSize, @@ -286,7 +286,7 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, { ItemLayoutProperties* const layout = items.getUnchecked (i); - double sizeWanted = sizeToRealSize (layout->preferredSize, availableSpace); + double sizeWanted = sizeToRealSize (layout->preferredSize, totalSize); int bestSize = jlimit (layout->currentSize, jmax (layout->currentSize, sizeToRealSize (layout->maxSize, totalSize)), diff --git a/src/native/mac/juce_iphone_Audio.cpp b/src/native/mac/juce_iphone_Audio.cpp index 17ce6af171..5a8e927e83 100644 --- a/src/native/mac/juce_iphone_Audio.cpp +++ b/src/native/mac/juce_iphone_Audio.cpp @@ -122,7 +122,9 @@ public: AudioSessionSetActive (true); - UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord; + UInt32 audioCategory = audioInputIsAvailable ? kAudioSessionCategory_PlayAndRecord + : kAudioSessionCategory_MediaPlayback; + AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (audioCategory), &audioCategory); AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange, propertyChangedStatic, this);