From 49929c1e57b1c4d33a840011314b3383fd0426e8 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Tue, 8 Jan 2019 00:55:46 +0100 Subject: [PATCH] Fix OSXCROSS build with clang-6.0 Backport from Fabio Alessandrelli's commit at 875d822d77f3088793cb0b4320c08b8f4d40a03e --- platform/osx/os_osx.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index f8f919a007b..5bba557b926 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1566,7 +1566,8 @@ String OS_OSX::get_godot_dir_name() const { String OS_OSX::get_system_dir(SystemDir p_dir) const { - NSSearchPathDirectory id = 0; + NSSearchPathDirectory id; + bool found = true; switch (p_dir) { case SYSTEM_DIR_DESKTOP: { @@ -1587,10 +1588,13 @@ String OS_OSX::get_system_dir(SystemDir p_dir) const { case SYSTEM_DIR_PICTURES: { id = NSPicturesDirectory; } break; + default: { + found = false; + } } String ret; - if (id) { + if (found) { NSArray *paths = NSSearchPathForDirectoriesInDomains(id, NSUserDomainMask, YES); if (paths && [paths count] >= 1) { @@ -2056,7 +2060,7 @@ static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) { CFDataRef layoutData = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData); if (!layoutData) - return nil; + return 0; const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout *)CFDataGetBytePtr(layoutData);