Permalink
Browse files

[osx/ios/atv2] - replace all __APPLE__ (even in conjunction with __ar…

…m__) definitions with the correct TARGET_DARWIN* definitions.
  • Loading branch information...
Memphiz committed May 28, 2012
1 parent 6f68bde commit 3afe96abce132994de95e0cd259310b3a77561de
Showing with 196 additions and 196 deletions.
  1. +14 −14 xbmc/Application.cpp
  2. +1 −1 xbmc/Application.h
  3. +2 −2 xbmc/ApplicationMessenger.cpp
  4. +2 −2 xbmc/GUIInfoManager.cpp
  5. +7 −7 xbmc/Util.cpp
  6. +1 −1 xbmc/addons/Addon.cpp
  7. +2 −2 xbmc/addons/AddonDll.h
  8. +3 −3 xbmc/addons/AddonManager.cpp
  9. +1 −1 xbmc/cores/DllLoader/DllLoaderContainer.cpp
  10. +14 −14 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
  11. +1 −1 xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
  12. +7 −7 xbmc/cores/DllLoader/ldt_keeper.c
  13. +1 −1 xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
  14. +1 −1 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
  15. +1 −1 xbmc/cores/dvdplayer/DVDCodecs/Audio/DllLibMad.h
  16. +6 −6 xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
  17. +3 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
  18. +1 −1 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
  19. +1 −1 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
  20. +2 −2 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp
  21. +1 −1 xbmc/cores/dvdplayer/DVDPlayer.cpp
  22. +1 −1 xbmc/cores/paplayer/CDDAcodec.cpp
  23. +1 −1 xbmc/dbwrappers/sqlitedataset.cpp
  24. +1 −1 xbmc/filesystem/SAPDirectory.cpp
  25. +4 −4 xbmc/filesystem/SMBDirectory.cpp
  26. +2 −2 xbmc/guilib/GUIEditControl.cpp
  27. +1 −1 xbmc/guilib/GraphicContext.cpp
  28. +1 −1 xbmc/guilib/Texture.cpp
  29. +1 −1 xbmc/guilib/TextureBundleXPR.cpp
  30. +1 −1 xbmc/guilib/XBTFReader.cpp
  31. +1 −1 xbmc/input/SDLJoystick.cpp
  32. +4 −4 xbmc/interfaces/Builtins.cpp
  33. +2 −2 xbmc/interfaces/python/XBPython.cpp
  34. +3 −3 xbmc/linux/LinuxTimezone.cpp
  35. +2 −2 xbmc/linux/PlatformDefs.h
  36. +2 −2 xbmc/linux/PosixMountProvider.cpp
  37. +5 −5 xbmc/linux/XFileUtils.cpp
  38. +3 −3 xbmc/linux/XMemUtils.cpp
  39. +3 −3 xbmc/linux/XTimeUtils.cpp
  40. +2 −2 xbmc/network/Zeroconf.cpp
  41. +2 −2 xbmc/network/ZeroconfBrowser.cpp
  42. +1 −1 xbmc/network/linux/NetworkLinux.h
  43. +2 −2 xbmc/osx/AutoPool.mm
  44. +1 −1 xbmc/powermanagement/DPMSSupport.cpp
  45. +2 −2 xbmc/powermanagement/PowerManager.cpp
  46. +3 −3 xbmc/powermanagement/osx/CocoaPowerSyscall.h
  47. +1 −1 xbmc/settings/AdvancedSettings.cpp
  48. +11 −11 xbmc/settings/GUISettings.cpp
  49. +3 −3 xbmc/settings/GUIWindowSettingsCategory.cpp
  50. +1 −1 xbmc/settings/Settings.cpp
  51. +1 −1 xbmc/settings/Settings.h
  52. +4 −4 xbmc/storage/DetectDVDType.cpp
  53. +7 −7 xbmc/storage/IoSupport.cpp
  54. +2 −2 xbmc/storage/MediaManager.cpp
  55. +2 −2 xbmc/storage/cdioSupport.cpp
  56. +3 −3 xbmc/storage/osx/DarwinStorageProvider.cpp
  57. +3 −3 xbmc/utils/AliasShortcutUtils.cpp
  58. +5 −5 xbmc/utils/CPUInfo.cpp
  59. +1 −1 xbmc/utils/CharsetConverter.cpp
  60. +1 −1 xbmc/utils/EndianSwap.h
  61. +1 −1 xbmc/utils/RssReader.cpp
  62. +1 −1 xbmc/utils/Stopwatch.cpp
  63. +6 −6 xbmc/utils/SystemInfo.cpp
  64. +1 −1 xbmc/utils/SystemInfo.h
  65. +1 −1 xbmc/utils/URIUtils.cpp
  66. +11 −11 xbmc/video/VideoReferenceClock.cpp
  67. +2 −2 xbmc/video/VideoReferenceClock.h
  68. +3 −3 xbmc/video/windows/GUIWindowFullScreen.cpp
  69. +1 −1 xbmc/windowing/osx/WinSystemIOS.h
  70. +1 −1 xbmc/windowing/osx/WinSystemIOS.mm
View
@@ -540,7 +540,7 @@ void CApplication::Preflight()
#endif
// run any platform preflight scripts.
-#if defined(__APPLE__) && !defined(__arm__)
+#if defined(TARGET_DARWIN_OSX)
CStdString install_path;
CUtil::GetHomePath(install_path);
@@ -665,7 +665,7 @@ bool CApplication::Create()
//depending on how it's compiled, SDL periodically calls XResetScreenSaver when it's fullscreen
//this might bring the monitor out of standby, so we have to disable it explicitly
//by passing 0 for overwrite to setsenv, the user can still override this by setting the environment variable
-#if defined(_LINUX) && !defined(__APPLE__)
+#if defined(_LINUX) && !defined(TARGET_DARWIN)
setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
#endif
@@ -691,7 +691,7 @@ bool CApplication::Create()
#endif
// for python scripts that check the OS
-#ifdef __APPLE__
+#if defined(TARGET_DARWIN)
setenv("OS","OS X",true);
#elif defined(_LINUX)
setenv("OS","Linux",true);
@@ -785,7 +785,7 @@ bool CApplication::Create()
g_RemoteControl.Initialize();
#endif
-#if defined(__APPLE__) && !defined(__arm__)
+#if defined(TARGET_DARWIN_OSX)
// Configure and possible manually start the helper.
XBMCHelper::GetInstance().Configure();
#endif
@@ -892,7 +892,7 @@ bool CApplication::InitDirectoriesLinux()
might be mixed case.
*/
-#if defined(_LINUX) && !defined(__APPLE__)
+#if defined(_LINUX) && !defined(TARGET_DARWIN)
CStdString userName;
if (getenv("USER"))
userName = getenv("USER");
@@ -973,7 +973,7 @@ bool CApplication::InitDirectoriesLinux()
bool CApplication::InitDirectoriesOSX()
{
-#ifdef __APPLE__
+#if defined(TARGET_DARWIN)
CStdString userName;
if (getenv("USER"))
userName = getenv("USER");
@@ -990,7 +990,7 @@ bool CApplication::InitDirectoriesOSX()
CUtil::GetHomePath(xbmcPath);
setenv("XBMC_HOME", xbmcPath.c_str(), 0);
-#if defined(__arm__)
+#if defined(TARGET_DARWIN_IOS)
CStdString fontconfigPath;
fontconfigPath = xbmcPath + "/system/players/dvdplayer/etc/fonts/fonts.conf";
setenv("FONTCONFIG_FILE", fontconfigPath.c_str(), 0);
@@ -1006,7 +1006,7 @@ bool CApplication::InitDirectoriesOSX()
// map our special drives
CSpecialProtocol::SetXBMCBinPath(xbmcPath);
CSpecialProtocol::SetXBMCPath(xbmcPath);
- #if defined(__arm__)
+ #if defined(TARGET_DARWIN_IOS)
CSpecialProtocol::SetHomePath(userHome + "/Library/Preferences/XBMC");
CSpecialProtocol::SetMasterProfilePath(userHome + "/Library/Preferences/XBMC/userdata");
#else
@@ -1015,7 +1015,7 @@ bool CApplication::InitDirectoriesOSX()
#endif
// location for temp files
- #if defined(__arm__)
+ #if defined(TARGET_DARWIN_IOS)
CStdString strTempPath = URIUtils::AddFileToFolder(userHome, "Library/Preferences/XBMC/temp");
#else
CStdString strTempPath = URIUtils::AddFileToFolder(userHome, ".xbmc/");
@@ -1025,7 +1025,7 @@ bool CApplication::InitDirectoriesOSX()
CSpecialProtocol::SetTempPath(strTempPath);
// xbmc.log file location
- #if defined(__arm__)
+ #if defined(TARGET_DARWIN_IOS)
strTempPath = userHome + "/Library/Preferences";
#else
strTempPath = userHome + "/Library/Logs";
@@ -3427,7 +3427,7 @@ void CApplication::Stop(int exitCode)
CLog::Log(LOGNOTICE, "unload skin");
UnloadSkin();
-#if defined(__APPLE__) && !defined(__arm__)
+#if defined(TARGET_DARWIN_OSX)
if (XBMCHelper::GetInstance().IsAlwaysOn() == false)
XBMCHelper::GetInstance().Stop();
#endif
@@ -3947,7 +3947,7 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)
}
#endif
-#if !defined(__APPLE__) && !defined(_LINUX)
+#if !defined(TARGET_DARWIN) && !defined(_LINUX)
g_audioManager.Enable(false);
#endif
}
@@ -4909,7 +4909,7 @@ void CApplication::ProcessSlow()
{
g_powerManager.ProcessEvents();
-#if defined(__APPLE__) && !defined(__arm__)
+#if defined(TARGET_DARWIN_OSX)
// There is an issue on OS X that several system services ask the cursor to become visible
// during their startup routines. Given that we can't control this, we hack it in by
// forcing the
@@ -4932,7 +4932,7 @@ void CApplication::ProcessSlow()
CheckScreenSaverAndDPMS();
// Check if we need to shutdown (if enabled).
-#ifdef __APPLE__
+#if defined(TARGET_DARWIN)
if (g_guiSettings.GetInt("powermanagement.shutdowntime") && g_advancedSettings.m_fullScreen)
#else
if (g_guiSettings.GetInt("powermanagement.shutdowntime"))
View
@@ -341,7 +341,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
bool m_skinReloading; // if true we disallow LoadSkin until ReloadSkin is called
friend class CApplicationMessenger;
-#if defined(__APPLE__) && defined(__arm__)
+#if defined(TARGET_DARWIN_IOS)
friend class CWinEventsIOS;
#endif
// screensaver
@@ -49,7 +49,7 @@
#ifdef _WIN32
#include "WIN32Util.h"
#define CHalManager CWIN32Util
-#elif defined __APPLE__
+#elif defined(TARGET_DARWIN)
#include "CocoaInterface.h"
#endif
#include "storage/MediaManager.h"
@@ -504,7 +504,7 @@ case TMSG_POWERDOWN:
break;
case TMSG_EXECUTE_OS:
-#if defined( _LINUX) && !defined(__APPLE__)
+#if defined( _LINUX) && !defined(TARGET_DARWIN)
CUtil::RunCommandLine(pMsg->strParam.c_str(), (pMsg->dwParam1 == 1));
#elif defined(_WIN32)
CWIN32Util::XBMCShellExecute(pMsg->strParam.c_str(), (pMsg->dwParam1 == 1));
View
@@ -1877,7 +1877,7 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
bReturn = g_application.IsMusicScanning();
}
else if (condition == SYSTEM_PLATFORM_LINUX)
-#if defined(_LINUX) && !defined(__APPLE__)
+#if defined(_LINUX) && !defined(TARGET_DARWIN)
bReturn = true;
#else
bReturn = false;
@@ -3632,7 +3632,7 @@ string CGUIInfoManager::GetSystemHeatInfo(int info)
text.Format("%i%%", m_fanSpeed * 2);
break;
case SYSTEM_CPU_USAGE:
-#if defined(__APPLE__) || defined(_WIN32)
+#if defined(TARGET_DARWIN) || defined(_WIN32)
text.Format("%d%%", g_cpuInfo.getUsedPercentage());
#else
text.Format("%s", g_cpuInfo.GetCoresUsageString());
View
@@ -20,7 +20,7 @@
*/
#include "threads/SystemClock.h"
#include "system.h"
-#ifdef __APPLE__
+#if defined(TARGET_DARWIN)
#include <sys/param.h>
#include <mach-o/dyld.h>
#endif
@@ -71,7 +71,7 @@
#include <shlobj.h>
#include "WIN32Util.h"
#endif
-#if defined(__APPLE__)
+#if defined(TARGET_DARWIN)
#include "osx/DarwinUtils.h"
#endif
#include "GUIUserMessages.h"
@@ -510,7 +510,7 @@ void CUtil::GetHomePath(CStdString& strPath, const CStdString& strTarget)
}
else
{
-#ifdef __APPLE__
+#if defined(TARGET_DARWIN)
int result = -1;
char given_path[2*MAXPATHLEN];
uint32_t path_size =2*MAXPATHLEN;
@@ -522,7 +522,7 @@ void CUtil::GetHomePath(CStdString& strPath, const CStdString& strTarget)
for (int n=strlen(given_path)-1; given_path[n] != '/'; n--)
given_path[n] = '\0';
- #if defined(__arm__)
+ #if defined(TARGET_DARWIN_IOS)
strcat(given_path, "/XBMCData/XBMCHome/");
#else
// Assume local path inside application bundle.
@@ -545,7 +545,7 @@ void CUtil::GetHomePath(CStdString& strPath, const CStdString& strTarget)
strPath = strHomePath;
}
-#if defined(_LINUX) && !defined(__APPLE__)
+#if defined(_LINUX) && !defined(TARGET_DARWIN)
/* Change strPath accordingly when target is XBMC_HOME and when INSTALL_PATH
* and BIN_INSTALL_PATH differ
*/
@@ -2185,7 +2185,7 @@ CStdString CUtil::ResolveExecutablePath()
::GetModuleFileNameW(0, szAppPathW, sizeof(szAppPathW)/sizeof(szAppPathW[0]) - 1);
CStdStringW strPathW = szAppPathW;
g_charsetConverter.wToUTF8(strPathW,strExecutablePath);
-#elif defined(__APPLE__)
+#elif defined(TARGET_DARWIN)
char given_path[2*MAXPATHLEN];
uint32_t path_size =2*MAXPATHLEN;
@@ -2225,7 +2225,7 @@ CStdString CUtil::ResolveExecutablePath()
CStdString CUtil::GetFrameworksPath(bool forPython)
{
CStdString strFrameworksPath;
-#if defined(__APPLE__)
+#if defined(TARGET_DARWIN)
char given_path[2*MAXPATHLEN];
uint32_t path_size =2*MAXPATHLEN;
View
@@ -26,7 +26,7 @@
#include "filesystem/Directory.h"
#include "filesystem/File.h"
#include "interfaces/python/XBPython.h"
-#ifdef __APPLE__
+#if defined(TARGET_DARWIN)
#include "../osx/OSXGNUReplacements.h"
#endif
#ifdef __FreeBSD__
View
@@ -83,13 +83,13 @@ CAddonDll<TheDll, TheStruct, TheProps>::CAddonDll(const cp_extension_t *ext)
{
if (ext)
{
-#if defined(_LINUX) && !defined(__APPLE__)
+#if defined(_LINUX) && !defined(TARGET_DARWIN)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_linux");
#elif defined(_WIN32) && defined(HAS_SDL_OPENGL)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_wingl");
#elif defined(_WIN32) && defined(HAS_DX)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_windx");
-#elif defined(__APPLE__)
+#elif defined(TARGET_DARWIN)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_osx");
#endif
}
@@ -116,7 +116,7 @@ AddonPtr CAddonMgr::Factory(const cp_extension_t *props)
{ // built in screensaver
return AddonPtr(new CAddon(props));
}
-#if defined(_LINUX) && !defined(__APPLE__)
+#if defined(_LINUX) && !defined(TARGET_DARWIN)
if ((value = GetExtValue(props->plugin->extensions->configuration, "@library_linux")) && value.empty())
break;
#elif defined(_WIN32) && defined(HAS_SDL_OPENGL)
@@ -125,7 +125,7 @@ AddonPtr CAddonMgr::Factory(const cp_extension_t *props)
#elif defined(_WIN32) && defined(HAS_DX)
if ((value = GetExtValue(props->plugin->extensions->configuration, "@library_windx")) && value.empty())
break;
-#elif defined(__APPLE__)
+#elif defined(TARGET_DARWIN)
if ((value = GetExtValue(props->plugin->extensions->configuration, "@library_osx")) && value.empty())
break;
#endif
@@ -580,7 +580,7 @@ bool CAddonMgr::PlatformSupportsAddon(const cp_plugin_info_t *plugin) const
{
if (platforms[i] == "all")
return true;
-#if defined(_LINUX) && !defined(__APPLE__)
+#if defined(_LINUX) && !defined(TARGET_DARWIN)
if (platforms[i] == "linux")
#elif defined(_WIN32) && defined(HAS_SDL_OPENGL)
if (platforms[i] == "wingl")
@@ -44,7 +44,7 @@
"special://xbmc/system/players/paplayer/;" \
"special://xbmc/system/python/"
-#ifdef __APPLE__
+#if defined(TARGET_DARWIN)
#define ENV_PATH ENV_PARTIAL_PATH \
";special://frameworks/"
#else
Oops, something went wrong.

0 comments on commit 3afe96a

Please sign in to comment.