You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

308 lines
16KB

  1. diff --git a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
  2. index acd165ff0..bdc0bf58f 100644
  3. --- a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
  4. +++ b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
  5. @@ -20,6 +20,11 @@
  6. ==============================================================================
  7. */
  8. +#ifndef __clang__
  9. +// GCC4 compatibility
  10. +namespace std { using ::max_align_t; }
  11. +#endif
  12. +
  13. namespace juce
  14. {
  15. diff --git a/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h b/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h
  16. index ac5ce32da..f0cd938ae 100644
  17. --- a/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h
  18. +++ b/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h
  19. @@ -236,8 +236,10 @@ private:
  20. { kAudioChannelLayoutTag_AAC_6_0, { centre, left, right, leftSurround, rightSurround, centreSurround } },
  21. { kAudioChannelLayoutTag_AAC_6_1, { centre, left, right, leftSurround, rightSurround, centreSurround, LFE } },
  22. { kAudioChannelLayoutTag_AAC_7_0, { centre, left, right, leftSurround, rightSurround, leftSurroundRear, rightSurroundRear } },
  23. +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8
  24. { kAudioChannelLayoutTag_AAC_7_1_B, { centre, left, right, leftSurround, rightSurround, leftSurroundRear, rightSurroundRear, LFE } },
  25. { kAudioChannelLayoutTag_AAC_7_1_C, { centre, left, right, leftSurround, rightSurround, LFE, topFrontLeft, topFrontRight } },
  26. +#endif
  27. { kAudioChannelLayoutTag_AAC_Octagonal, { centre, left, right, leftSurround, rightSurround, leftSurroundRear, rightSurroundRear, centreSurround } },
  28. { kAudioChannelLayoutTag_TMH_10_2_std, { left, right, centre, topFrontCentre, leftSurroundSide, rightSurroundSide, leftSurround, rightSurround, topFrontLeft, topFrontRight, wideLeft, wideRight, topRearCentre, centreSurround, LFE, LFE2 } },
  29. { kAudioChannelLayoutTag_AC3_1_0_1, { centre, LFE } },
  30. diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  31. index 9aa4a338e..7cad3e7c1 100644
  32. --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  33. +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  34. @@ -59,6 +59,10 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
  35. namespace juce
  36. {
  37. +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_8
  38. +static const uint32 kAudioUnitType_MIDIProcessor = 'aumi';
  39. +#endif
  40. +
  41. // Change this to disable logging of various activities
  42. #ifndef AU_LOGGING
  43. #define AU_LOGGING 1
  44. @@ -276,7 +280,7 @@ namespace AudioUnitFormatHelpers
  45. NSBundle* bundle = [[NSBundle alloc] initWithPath: (NSString*) fileOrIdentifier.toCFString()];
  46. NSArray* audioComponents = [bundle objectForInfoDictionaryKey: @"AudioComponents"];
  47. - NSDictionary* dict = audioComponents[0];
  48. + NSDictionary* dict = [audioComponents objectAtIndex: 0];
  49. desc.componentManufacturer = stringToOSType (nsStringToJuce ((NSString*) [dict valueForKey: @"manufacturer"]));
  50. desc.componentType = stringToOSType (nsStringToJuce ((NSString*) [dict valueForKey: @"type"]));
  51. diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h
  52. index 39eac8211..f556f12b3 100644
  53. --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h
  54. +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h
  55. @@ -1184,7 +1184,7 @@ public:
  56. String xMeterID, yMeterID;
  57. };
  58. - virtual CurveData getResponseCurve (CurveData::Type /*curveType*/) const { return {}; }
  59. + virtual CurveData getResponseCurve (CurveData::Type /*curveType*/) const { return CurveData(); }
  60. //==============================================================================
  61. /** Not for public use - this is called before deleting an editor component. */
  62. diff --git a/modules/juce_core/native/juce_osx_ObjCHelpers.h b/modules/juce_core/native/juce_osx_ObjCHelpers.h
  63. index a9a7c8eb7..aa068eaa0 100644
  64. --- a/modules/juce_core/native/juce_osx_ObjCHelpers.h
  65. +++ b/modules/juce_core/native/juce_osx_ObjCHelpers.h
  66. @@ -71,7 +71,7 @@ inline NSArray* varArrayToNSArray (const var& varToParse);
  67. inline NSDictionary* varObjectToNSDictionary (const var& varToParse)
  68. {
  69. - auto dictionary = [NSMutableDictionary dictionary];
  70. + NSDictionary* dictionary = [NSMutableDictionary dictionary];
  71. if (varToParse.isObject())
  72. {
  73. @@ -118,7 +118,7 @@ inline NSArray* varArrayToNSArray (const var& varToParse)
  74. const auto* varArray = varToParse.getArray();
  75. - auto array = [NSMutableArray arrayWithCapacity: (NSUInteger) varArray->size()];
  76. + NSArray* array = [NSMutableArray arrayWithCapacity: (NSUInteger) varArray->size()];
  77. for (const auto& aVar : *varArray)
  78. {
  79. @@ -152,7 +152,8 @@ inline var nsDictionaryToVar (NSDictionary* dictionary)
  80. DynamicObject::Ptr dynamicObject (new DynamicObject());
  81. for (NSString* key in dictionary)
  82. - dynamicObject->setProperty (nsStringToJuce (key), nsObjectToVar (dictionary[key]));
  83. + dynamicObject->setProperty (nsStringToJuce (key),
  84. + nsObjectToVar ([dictionary objectForKey: key]));
  85. return var (dynamicObject.get());
  86. }
  87. diff --git a/modules/juce_core/system/juce_CompilerSupport.h b/modules/juce_core/system/juce_CompilerSupport.h
  88. index 4d96d7cb0..d76d92d49 100644
  89. --- a/modules/juce_core/system/juce_CompilerSupport.h
  90. +++ b/modules/juce_core/system/juce_CompilerSupport.h
  91. @@ -92,7 +92,7 @@
  92. //==============================================================================
  93. // C++ library
  94. -#if (defined (__GLIBCXX__) && __GLIBCXX__ < 20130322) || (defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 3700))
  95. +#if (defined (__GLIBCXX__) && __GLIBCXX__ < 20130322)
  96. #error "JUCE requires a C++ library containing std::atomic"
  97. #endif
  98. diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h
  99. index 43000cab6..0a1798ba2 100644
  100. --- a/modules/juce_core/system/juce_PlatformDefs.h
  101. +++ b/modules/juce_core/system/juce_PlatformDefs.h
  102. @@ -99,11 +99,7 @@ namespace juce
  103. deliberately and want to ignore the warning.
  104. */
  105. #if JUCE_CLANG
  106. - #if __has_cpp_attribute(clang::fallthrough)
  107. - #define JUCE_FALLTHROUGH [[clang::fallthrough]];
  108. - #else
  109. - #define JUCE_FALLTHROUGH
  110. - #endif
  111. + #define JUCE_FALLTHROUGH [[clang::fallthrough]];
  112. #elif JUCE_GCC
  113. #if __GNUC__ >= 7
  114. #define JUCE_FALLTHROUGH [[gnu::fallthrough]];
  115. diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h
  116. index 5b4d293bb..6b41688b2 100644
  117. --- a/modules/juce_core/system/juce_TargetPlatform.h
  118. +++ b/modules/juce_core/system/juce_TargetPlatform.h
  119. @@ -145,8 +145,8 @@
  120. #endif
  121. #if JUCE_MAC
  122. - #if ! defined (MAC_OS_X_VERSION_10_11)
  123. - #error "The 10.11 SDK (Xcode 7.3.1+) is required to build JUCE apps. You can create apps that run on macOS 10.7+ by changing the deployment target."
  124. + #if ! defined (MAC_OS_X_VERSION_10_8)
  125. + #error "The 10.8 SDK is required to build JUCE apps. You can create apps that run on macOS 10.7+ by changing the deployment target."
  126. #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
  127. #error "Building for OSX 10.6 is no longer supported!"
  128. #endif
  129. diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
  130. index de6ffecfc..2a85d25f5 100644
  131. --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
  132. +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
  133. @@ -26,6 +26,10 @@
  134. namespace juce
  135. {
  136. +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_8
  137. + #define __nullable
  138. +#endif
  139. +
  140. //==============================================================================
  141. // This class has been renamed from CoreGraphicsImage to avoid a symbol
  142. // collision in Pro Tools 2019.12 and possibly 2020 depending on the Pro Tools
  143. diff --git a/modules/juce_graphics/native/juce_mac_Fonts.mm b/modules/juce_graphics/native/juce_mac_Fonts.mm
  144. index ff0a23a9f..88142091d 100644
  145. --- a/modules/juce_graphics/native/juce_mac_Fonts.mm
  146. +++ b/modules/juce_graphics/native/juce_mac_Fonts.mm
  147. @@ -359,20 +359,20 @@ namespace CoreTextTypeLayout
  148. auto verticalJustification = text.getJustification().getOnlyVerticalFlags();
  149. - auto ctFrameArea = [area, minCTFrameHeight, verticalJustification]
  150. + const Rectangle<float> ctFrameArea = [area, minCTFrameHeight, verticalJustification]
  151. {
  152. if (minCTFrameHeight < area.getHeight())
  153. - return area;
  154. + return Rectangle<float> (area);
  155. if (verticalJustification == Justification::verticallyCentred)
  156. return area.withSizeKeepingCentre (area.getWidth(), minCTFrameHeight);
  157. - auto frameArea = area.withHeight (minCTFrameHeight);
  158. + const Rectangle<float> frameArea = area.withHeight (minCTFrameHeight);
  159. if (verticalJustification == Justification::bottom)
  160. return frameArea.withBottomY (area.getBottom());
  161. - return frameArea;
  162. + return Rectangle<float> (frameArea);
  163. }();
  164. auto frame = createCTFrame (framesetter, CGRectMake ((CGFloat) ctFrameArea.getX(), flipHeight - (CGFloat) ctFrameArea.getBottom(),
  165. diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  166. index 26ca40630..bd5e69ab0 100644
  167. --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  168. +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  169. @@ -1583,17 +1583,21 @@ private:
  170. case NSEventTypeSystemDefined:
  171. case NSEventTypeApplicationDefined:
  172. case NSEventTypePeriodic:
  173. + #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8
  174. case NSEventTypeGesture:
  175. + #endif
  176. case NSEventTypeMagnify:
  177. case NSEventTypeSwipe:
  178. case NSEventTypeRotate:
  179. case NSEventTypeBeginGesture:
  180. case NSEventTypeEndGesture:
  181. case NSEventTypeQuickLook:
  182. - #if JUCE_64BIT
  183. + #if JUCE_64BIT
  184. case NSEventTypeSmartMagnify:
  185. + #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8
  186. case NSEventTypePressure:
  187. #endif
  188. + #endif
  189. #if defined (MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
  190. #if JUCE_64BIT
  191. case NSEventTypeDirectTouch:
  192. diff --git a/modules/juce_gui_basics/native/juce_mac_Windowing.mm b/modules/juce_gui_basics/native/juce_mac_Windowing.mm
  193. index 918f0b4a6..63e15d07b 100644
  194. --- a/modules/juce_gui_basics/native/juce_mac_Windowing.mm
  195. +++ b/modules/juce_gui_basics/native/juce_mac_Windowing.mm
  196. @@ -309,7 +309,7 @@ bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& fi
  197. for (auto& filename : files)
  198. {
  199. auto* nsFilename = juceStringToNS (filename);
  200. - auto fileURL = [NSURL fileURLWithPath: nsFilename];
  201. + NSURL* fileURL = [NSURL fileURLWithPath: nsFilename];
  202. auto dragItem = [[NSDraggingItem alloc] initWithPasteboardWriter: fileURL];
  203. auto eventPos = [event locationInWindow];
  204. diff --git a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp
  205. index b8e6e0c7e..6ad01c68a 100644
  206. --- a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp
  207. +++ b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp
  208. @@ -3329,7 +3329,7 @@ void XWindowSystem::handleButtonPressEvent (LinuxComponentPeer* peer, const XBut
  209. peer->toFront (true);
  210. peer->handleMouseEvent (MouseInputSource::InputSourceType::mouse, getLogicalMousePos (buttonPressEvent, peer->getPlatformScaleFactor()),
  211. ModifierKeys::currentModifiers, MouseInputSource::invalidPressure,
  212. - MouseInputSource::invalidOrientation, getEventTime (buttonPressEvent), {});
  213. + MouseInputSource::invalidOrientation, getEventTime (buttonPressEvent));
  214. }
  215. void XWindowSystem::handleButtonPressEvent (LinuxComponentPeer* peer, const XButtonPressedEvent& buttonPressEvent) const
  216. diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.h b/modules/juce_gui_basics/windows/juce_ComponentPeer.h
  217. index 691e5679b..ed4f3c199 100644
  218. --- a/modules/juce_gui_basics/windows/juce_ComponentPeer.h
  219. +++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.h
  220. @@ -321,7 +321,7 @@ public:
  221. //==============================================================================
  222. void handleMouseEvent (MouseInputSource::InputSourceType type, Point<float> positionWithinPeer, ModifierKeys newMods, float pressure,
  223. - float orientation, int64 time, PenDetails pen = {}, int touchIndex = 0);
  224. + float orientation, int64 time, PenDetails pen = PenDetails(), int touchIndex = 0);
  225. void handleMouseWheel (MouseInputSource::InputSourceType type, Point<float> positionWithinPeer,
  226. int64 time, const MouseWheelDetails&, int touchIndex = 0);
  227. diff --git a/modules/juce_gui_extra/juce_gui_extra.cpp b/modules/juce_gui_extra/juce_gui_extra.cpp
  228. index 9cf367411..d42555e13 100644
  229. --- a/modules/juce_gui_extra/juce_gui_extra.cpp
  230. +++ b/modules/juce_gui_extra/juce_gui_extra.cpp
  231. @@ -136,7 +136,9 @@
  232. #include "misc/juce_PushNotifications.cpp"
  233. #include "misc/juce_RecentlyOpenedFilesList.cpp"
  234. #include "misc/juce_SplashScreen.cpp"
  235. +#if !JUCE_MAC || MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8
  236. #include "misc/juce_SystemTrayIconComponent.cpp"
  237. +#endif
  238. #include "misc/juce_LiveConstantEditor.cpp"
  239. #include "misc/juce_AnimatedAppComponent.cpp"
  240. @@ -146,7 +148,9 @@
  241. #if JUCE_MAC
  242. #include "native/juce_mac_NSViewComponent.mm"
  243. #include "native/juce_mac_AppleRemote.mm"
  244. - #include "native/juce_mac_SystemTrayIcon.cpp"
  245. + #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8
  246. + #include "native/juce_mac_SystemTrayIcon.cpp"
  247. + #endif
  248. #endif
  249. #if JUCE_IOS
  250. diff --git a/modules/juce_gui_extra/juce_gui_extra.h b/modules/juce_gui_extra/juce_gui_extra.h
  251. index bcec491c9..062bde636 100644
  252. --- a/modules/juce_gui_extra/juce_gui_extra.h
  253. +++ b/modules/juce_gui_extra/juce_gui_extra.h
  254. @@ -115,7 +115,9 @@
  255. #include "misc/juce_PushNotifications.h"
  256. #include "misc/juce_RecentlyOpenedFilesList.h"
  257. #include "misc/juce_SplashScreen.h"
  258. +#if !JUCE_MAC || MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_8
  259. #include "misc/juce_SystemTrayIconComponent.h"
  260. +#endif
  261. #include "misc/juce_WebBrowserComponent.h"
  262. #include "misc/juce_LiveConstantEditor.h"
  263. #include "misc/juce_AnimatedAppComponent.h"
  264. diff --git a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp
  265. index 9786c0875..34695b5e1 100644
  266. --- a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp
  267. +++ b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp
  268. @@ -157,7 +157,7 @@ void RecentlyOpenedFilesList::forgetRecentFileNatively (const File& file)
  269. // from the recent list, so we clear them all and add them back excluding
  270. // the specified file
  271. - auto sharedDocController = [NSDocumentController sharedDocumentController];
  272. + NSDocumentController* sharedDocController = [NSDocumentController sharedDocumentController];
  273. auto recentDocumentURLs = [sharedDocController recentDocumentURLs];
  274. [sharedDocController clearRecentDocuments: nil];