Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2822 from davilla/die_LINUX-die

Die linux die
  • Loading branch information...
commit 7b65508685ef7a6f3c16e9b341b2b71fafaa46b2 2 parents 95d5f80 + 1e8efd9
@davilla davilla authored
Showing with 688 additions and 693 deletions.
  1. +1 −1  lib/UnrarXLib/cmddata.cpp
  2. +1 −1  lib/UnrarXLib/consio.cpp
  3. +1 −1  lib/UnrarXLib/crypt.cpp
  4. +3 −3 lib/UnrarXLib/errhnd.cpp
  5. +7 −7 lib/UnrarXLib/file.cpp
  6. +8 −8 lib/UnrarXLib/filefn.cpp
  7. +1 −1  lib/UnrarXLib/filestr.cpp
  8. +1 −1  lib/UnrarXLib/find.cpp
  9. +2 −2 lib/UnrarXLib/os.hpp
  10. +1 −1  lib/UnrarXLib/pathfn.cpp
  11. +2 −2 lib/UnrarXLib/rar.cpp
  12. +2 −2 lib/UnrarXLib/suballoc.hpp
  13. +1 −1  lib/UnrarXLib/unicode.cpp
  14. +1 −1  lib/libRTV/rtv.h
  15. +3 −8 lib/libXDAAP/private.h
  16. +22 −22 xbmc/Application.cpp
  17. +4 −4 xbmc/Application.h
  18. +3 −3 xbmc/ApplicationMessenger.cpp
  19. +2 −2 xbmc/Autorun.cpp
  20. +1 −1  xbmc/BackgroundInfoLoader.cpp
  21. +2 −2 xbmc/DllPaths.h
  22. +3 −3 xbmc/DllPaths_generated.h.in
  23. +4 −4 xbmc/GUIInfoManager.cpp
  24. +4 −4 xbmc/LangInfo.cpp
  25. +3 −3 xbmc/URL.cpp
  26. +1 −1  xbmc/URL.h
  27. +22 −22 xbmc/Util.cpp
  28. +3 −3 xbmc/Util.h
  29. +1 −1  xbmc/addons/Addon.cpp
  30. +3 −3 xbmc/addons/AddonDll.h
  31. +6 −6 xbmc/addons/AddonManager.cpp
  32. +1 −1  xbmc/addons/Visualisation.cpp
  33. +1 −1  xbmc/addons/include/xbmc_addon_dll.h
  34. +1 −1  xbmc/addons/include/xbmc_pvr_types.h
  35. +1 −1  xbmc/cdrip/CDDARipJob.cpp
  36. +1 −1  xbmc/cdrip/CDDARipper.cpp
  37. +1 −1  xbmc/cdrip/DllOgg.h
  38. +1 −1  xbmc/cdrip/DllVorbis.h
  39. +1 −1  xbmc/cdrip/DllVorbisEnc.h
  40. +1 −1  xbmc/cdrip/EncoderFFmpeg.cpp
  41. +1 −1  xbmc/cdrip/EncoderLame.cpp
  42. +1 −1  xbmc/cores/AudioEngine/Sinks/AESinkNULL.cpp
  43. +3 −3 xbmc/cores/DllLoader/DllLoader.cpp
  44. +5 −5 xbmc/cores/DllLoader/DllLoaderContainer.cpp
  45. +1 −1  xbmc/cores/DllLoader/LibraryLoader.h
  46. +1 −1  xbmc/cores/DllLoader/SoLoader.h
  47. +2 −2 xbmc/cores/DllLoader/coff.cpp
  48. +1 −1  xbmc/cores/DllLoader/coff.h
  49. +1 −1  xbmc/cores/DllLoader/dll.cpp
  50. +3 −3 xbmc/cores/DllLoader/dll_tracker.h
  51. +1 −1  xbmc/cores/DllLoader/dll_tracker_file.cpp
  52. +2 −2 xbmc/cores/DllLoader/dll_util.cpp
  53. +28 −28 xbmc/cores/DllLoader/exports/emu_kernel32.cpp
  54. +5 −5 xbmc/cores/DllLoader/exports/emu_kernel32.h
  55. +41 −41 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
  56. +10 −10 xbmc/cores/DllLoader/exports/emu_msvcrt.h
  57. +2 −2 xbmc/cores/DllLoader/exports/emu_socket/inet_aton.c
  58. +1 −1  xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
  59. +5 −5 xbmc/cores/DllLoader/exports/wrapper.c
  60. +6 −6 xbmc/cores/DllLoader/ldt_keeper.c
  61. +15 −15 xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
  62. +3 −3 xbmc/cores/ExternalPlayer/ExternalPlayer.h
  63. +2 −2 xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
  64. +2 −2 xbmc/cores/VideoRenderers/LinuxRendererGL.h
  65. +1 −1  xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
  66. +1 −1  xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.cpp
  67. +1 −1  xbmc/cores/VideoRenderers/WinRenderer.h
  68. +1 −1  xbmc/cores/dvdplayer/DVDAudio.h
  69. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
  70. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
  71. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
  72. +2 −2 xbmc/cores/dvdplayer/DVDCodecs/Audio/DllLibMad.h
  73. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
  74. +9 −9 xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
  75. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/Overlay/libspucc/cc_decoder.c
  76. +2 −2 xbmc/cores/dvdplayer/DVDCodecs/Overlay/libspucc/cc_decoder.h
  77. +3 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
  78. +2 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp
  79. +3 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
  80. +2 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp
  81. +1 −1  xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp
  82. +2 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/DllLibMpeg2.h
  83. +2 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMax.cpp
  84. +2 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp
  85. +2 −2 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
  86. +3 −3 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxBXA.h
  87. +1 −1  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.h
  88. +1 −1  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
  89. +1 −1  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h
  90. +1 −1  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
  91. +2 −2 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.cpp
  92. +2 −2 xbmc/cores/dvdplayer/DVDInputStreams/DVDStateSerializer.cpp
  93. +1 −1  xbmc/cores/dvdplayer/DVDInputStreams/dvdnav/config.h
  94. +7 −7 xbmc/cores/dvdplayer/DVDInputStreams/dvdnav/dvdnav_internal.h
  95. +2 −2 xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
  96. +1 −1  xbmc/cores/dvdplayer/DVDPlayerSubtitle.cpp
  97. +1 −1  xbmc/cores/dvdplayer/DVDStreamInfo.h
  98. +2 −2 xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h
  99. +2 −2 xbmc/cores/omxplayer/OMXAudio.cpp
  100. +1 −1  xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp
  101. +2 −2 xbmc/cores/omxplayer/OMXImage.cpp
  102. +2 −2 xbmc/cores/omxplayer/OMXPlayerAudio.cpp
  103. +2 −2 xbmc/cores/omxplayer/OMXPlayerVideo.cpp
  104. +2 −2 xbmc/cores/omxplayer/OMXVideo.cpp
  105. +5 −5 xbmc/cores/paplayer/SPCCodec.cpp
  106. +2 −2 xbmc/cores/paplayer/SPCCodec.h
  107. +2 −2 xbmc/cores/paplayer/TimidityCodec.cpp
  108. +1 −1  xbmc/cores/paplayer/WAVcodec.cpp
  109. +2 −2 xbmc/dbwrappers/dataset.cpp
  110. +1 −1  xbmc/dbwrappers/mysqldataset.cpp
  111. +1 −1  xbmc/dbwrappers/sqlitedataset.cpp
  112. +1 −1  xbmc/dialogs/GUIDialogContextMenu.cpp
  113. +3 −3 xbmc/filesystem/AFPFile.cpp
  114. +2 −2 xbmc/filesystem/AFPFile.h
  115. +2 −2 xbmc/filesystem/CDDAFile.cpp
  116. +2 −2 xbmc/filesystem/CacheStrategy.cpp
  117. +1 −1  xbmc/filesystem/CacheStrategy.h
  118. +3 −3 xbmc/filesystem/CircularCache.cpp
  119. +1 −1  xbmc/filesystem/CircularCache.h
  120. +1 −1  xbmc/filesystem/CurlFile.cpp
  121. +3 −3 xbmc/filesystem/DirectoryFactory.cpp
  122. +1 −1  xbmc/filesystem/FTPParse.cpp
  123. +1 −1  xbmc/filesystem/File.cpp
  124. +3 −3 xbmc/filesystem/FileFactory.cpp
  125. +8 −8 xbmc/filesystem/HDDirectory.cpp
  126. +12 −12 xbmc/filesystem/HDFile.cpp
  127. +1 −1  xbmc/filesystem/IFile.h
  128. +1 −1  xbmc/filesystem/MemBufferCache.cpp
  129. +1 −1  xbmc/filesystem/RTVFile.cpp
  130. +1 −1  xbmc/filesystem/RarFile.cpp
  131. +1 −1  xbmc/filesystem/RarManager.cpp
  132. +1 −1  xbmc/filesystem/SAPDirectory.cpp
  133. +1 −1  xbmc/filesystem/SFTPFile.cpp
  134. +4 −4 xbmc/filesystem/SMBDirectory.cpp
  135. +3 −3 xbmc/filesystem/SmbFile.h
  136. +3 −3 xbmc/filesystem/SpecialProtocol.cpp
  137. +1 −1  xbmc/filesystem/SpecialProtocol.h
  138. +1 −1  xbmc/filesystem/VirtualDirectory.cpp
  139. +1 −1  xbmc/filesystem/iso9660.cpp
  140. +1 −1  xbmc/filesystem/iso9660.h
  141. +1 −1  xbmc/guilib/AnimatedGif.cpp
  142. +1 −1  xbmc/guilib/DirectXGraphics.h
  143. +1 −1  xbmc/guilib/GUICallback.h
  144. +2 −2 xbmc/guilib/GUIEditControl.cpp
  145. +2 −2 xbmc/guilib/GUIFontManager.cpp
  146. +1 −1  xbmc/guilib/GUIFontTTF.cpp
  147. +2 −2 xbmc/guilib/GUIKeyboard.h
  148. +1 −1  xbmc/guilib/GraphicContext.cpp
  149. +1 −1  xbmc/guilib/TextureBundleXBT.cpp
  150. +5 −5 xbmc/guilib/TextureBundleXPR.cpp
  151. +3 −3 xbmc/guilib/XBTFReader.cpp
  152. +1 −1  xbmc/guilib/gui3d.h
  153. +5 −5 xbmc/input/ButtonTranslator.cpp
  154. +2 −2 xbmc/input/KeyboardLayoutConfiguration.h
  155. +1 −1  xbmc/interfaces/Builtins.cpp
  156. +1 −1  xbmc/interfaces/legacy/ModuleXbmc.cpp
  157. +1 −1  xbmc/interfaces/python/LanguageHook.h
  158. +2 −2 xbmc/interfaces/python/XBPyThread.cpp
  159. +7 −7 xbmc/interfaces/python/XBPython.cpp
  160. +1 −1  xbmc/linux/ConvUtils.cpp
  161. +1 −1  xbmc/linux/LinuxTimezone.cpp
  162. +2 −2 xbmc/linux/OMXClock.cpp
  163. +3 −3 xbmc/linux/OMXCore.cpp
  164. +4 −4 xbmc/linux/PlatformDefs.h
  165. +1 −1  xbmc/linux/PosixMountProvider.cpp
  166. +9 −9 xbmc/linux/XFileUtils.cpp
  167. +1 −1  xbmc/linux/XFileUtils.h
  168. +2 −2 xbmc/linux/XHandle.h
  169. +3 −3 xbmc/linux/XMemUtils.cpp
  170. +3 −3 xbmc/linux/XTimeUtils.cpp
  171. +3 −3 xbmc/main/main.cpp
  172. +1 −1  xbmc/network/DNSNameCache.cpp
  173. +1 −1  xbmc/network/GUIDialogAccessPoints.cpp
  174. +1 −1  xbmc/network/Socket.cpp
  175. +2 −2 xbmc/network/Socket.h
  176. +2 −2 xbmc/network/UdpClient.cpp
  177. +1 −1  xbmc/network/WebServer.cpp
  178. +2 −2 xbmc/network/Zeroconf.cpp
  179. +2 −2 xbmc/network/ZeroconfBrowser.cpp
  180. +1 −1  xbmc/network/ZeroconfBrowser.h
  181. +1 −1  xbmc/network/cddb.h
  182. +1 −1  xbmc/network/linux/NetworkLinux.cpp
  183. +3 −3 xbmc/osx/atv2/xbmcclient.h
  184. +1 −1  xbmc/peripherals/PeripheralTypes.h
  185. +1 −1  xbmc/peripherals/bus/linux/PeripheralBusUSBLibUSB.cpp
  186. +1 −1  xbmc/pictures/DllImageLib.h
  187. +1 −1  xbmc/pictures/Picture.cpp
  188. +2 −2 xbmc/powermanagement/DPMSSupport.cpp
  189. +5 −5 xbmc/powermanagement/PowerManager.cpp
  190. +1 −1  xbmc/powermanagement/windows/Win32PowerSyscall.cpp
  191. +1 −1  xbmc/powermanagement/windows/Win32PowerSyscall.h
  192. +2 −2 xbmc/rendering/gl/RenderSystemGL.cpp
  193. +1 −1  xbmc/settings/AdvancedSettings.cpp
  194. +1 −1  xbmc/settings/DisplaySettings.cpp
  195. +4 −4 xbmc/settings/Settings.cpp
  196. +4 −4 xbmc/storage/DetectDVDType.cpp
  197. +11 −11 xbmc/storage/IoSupport.cpp
  198. +17 −17 xbmc/storage/MediaManager.cpp
  199. +1 −1  xbmc/storage/cdioSupport.cpp
  200. +1 −1  xbmc/test/TestBasicEnvironment.cpp
  201. +2 −2 xbmc/test/TestUtils.cpp
  202. +6 −6 xbmc/threads/Atomics.cpp
  203. +2 −2 xbmc/threads/platform/pthreads/ThreadImpl.cpp
  204. +5 −5 xbmc/utils/AliasShortcutUtils.cpp
  205. +1 −1  xbmc/utils/BitstreamStats.h
  206. +8 −8 xbmc/utils/CPUInfo.cpp
  207. +1 −1  xbmc/utils/CharsetConverter.cpp
  208. +1 −1  xbmc/utils/CryptThreading.cpp
  209. +2 −2 xbmc/utils/EndianSwap.h
  210. +1 −1  xbmc/utils/FileOperationJob.cpp
  211. +1 −1  xbmc/utils/LangCodeExpander.cpp
  212. +6 −6 xbmc/utils/MathUtils.h
  213. +3 −3 xbmc/utils/PerformanceSample.cpp
  214. +2 −2 xbmc/utils/PerformanceSample.h
  215. +1 −1  xbmc/utils/RegExp.h
  216. +5 −5 xbmc/utils/StdString.h
  217. +3 −3 xbmc/utils/Stopwatch.cpp
  218. +12 −12 xbmc/utils/SystemInfo.cpp
  219. +2 −2 xbmc/utils/SystemInfo.h
  220. +3 −3 xbmc/utils/URIUtils.cpp
  221. +1 −1  xbmc/utils/Weather.cpp
  222. +1 −1  xbmc/utils/XBMCTinyXML.h
  223. +1 −1  xbmc/utils/XMLUtils.cpp
  224. +1 −1  xbmc/utils/fastmemcpy.c
  225. +1 −1  xbmc/utils/fastmemcpy.h
  226. +1 −1  xbmc/utils/md5.cpp
  227. +2 −2 xbmc/utils/test/TestSystemInfo.cpp
  228. +1 −1  xbmc/video/VideoDatabase.h
  229. +10 −10 xbmc/video/VideoReferenceClock.cpp
  230. +2 −2 xbmc/video/VideoReferenceClock.h
  231. +1 −1  xbmc/view/ViewDatabase.cpp
  232. +2 −2 xbmc/visualizations/EGLHelpers/VisMatrixGLES.h
  233. +2 −2 xbmc/visualizations/EGLHelpers/VisShader.h
  234. +2 −2 xbmc/win32/PlatformDefs.h
  235. +4 −4 xbmc/win32/WIN32Util.cpp
  236. +8 −8 xbmc/windowing/WinEventsSDL.cpp
  237. +2 −2 xbmc/windowing/WinEventsSDL.h
  238. +1 −1  xbmc/windowing/X11/XRandR.cpp
  239. +1 −1  xbmc/windowing/osx/WinSystemOSXGL.mm
  240. +1 −1  xbmc/windowing/windows/WinEventsWin32.cpp
  241. +1 −1  xbmc/windowing/windows/WinSystemWin32.cpp
  242. +1 −1  xbmc/windows/GUIWindowDebugInfo.cpp
  243. +2 −2 xbmc/windows/GUIWindowDebugInfo.h
View
2  lib/UnrarXLib/cmddata.cpp
@@ -126,7 +126,7 @@ void CommandData::ParseDone()
}
-#if !defined(SFX_MODULE) && !defined(_WIN_CE) && !defined(_LINUX)
+#if !defined(SFX_MODULE) && !defined(_WIN_CE) && !defined(TARGET_POSIX)
void CommandData::ParseEnvVar()
{
char *EnvStr=getenv("RAR");
View
2  lib/UnrarXLib/consio.cpp
@@ -1,4 +1,4 @@
-#if !defined(_LINUX) && !defined(_XBMC)
+#if !defined(TARGET_POSIX) && !defined(_XBMC)
#include "rar.hpp"
#ifndef GUI
View
2  lib/UnrarXLib/crypt.cpp
@@ -201,7 +201,7 @@ void CryptData::SetCryptKeys(char *Password,byte *Salt,bool Encrypt,bool OldOnly
Key[2]=0x7515A235L;
Key[3]=0xA4E7F123L;
memset(Psw,0,sizeof(Psw));
-#if defined(_WIN_32) && !defined(GUI) && !defined(_LINUX)
+#if defined(_WIN_32) && !defined(GUI) && !defined(TARGET_POSIX)
CharToOemBuff(Password,(char*)Psw,strlen(Password));
#else
strncpy((char *)Psw,Password,MAXPASSWORD-1);
View
6 lib/UnrarXLib/errhnd.cpp
@@ -265,7 +265,7 @@ extern "C"
void _stdfunction ProcessSignal(int SigType)
#endif
{
-#if defined(_WIN_32) && !defined(_LINUX)
+#if defined(_WIN_32) && !defined(TARGET_POSIX)
if (SigType==CTRL_LOGOFF_EVENT)
return(TRUE);
#endif
@@ -280,7 +280,7 @@ void _stdfunction ProcessSignal(int SigType)
#if defined(USE_RC) && !defined(SFX_MODULE) && !defined(_WIN_CE)
ExtRes.UnloadDLL();
#endif
-#if !defined(_LINUX)
+#if !defined(TARGET_POSIX)
exit(USER_BREAK);
#endif
#ifdef _WIN_32
@@ -313,7 +313,7 @@ void ErrorHandler::Throw(int Code)
throw Code;
#else
File::RemoveCreated();
-#if !defined(_XBMC) && !defined(_LINUX)
+#if !defined(_XBMC) && !defined(TARGET_POSIX)
exit(Code);
#endif
#endif
View
14 lib/UnrarXLib/file.cpp
@@ -230,7 +230,7 @@ bool File::Close()
{*/
if (!SkipClose)
{
-#if defined(_WIN_32) || defined(_LINUX)
+#if defined(_WIN_32) || defined(TARGET_POSIX)
//success=CloseHandle(hFile) != FALSE;
m_File.Close();
#else
@@ -320,7 +320,7 @@ void File::Write(const void *Data,int Size)
while (1)
{
bool success = true;
-#if defined(_WIN_32) || defined(_LINUX)
+#if defined(_WIN_32) || defined(TARGET_POSIX)
DWORD Written=0;
if (HandleType!=FILE_HANDLENORMAL)
{
@@ -350,7 +350,7 @@ void File::Write(const void *Data,int Size)
#endif
if (ErrHandler.AskRepeatWrite(FileName))
{
-#if !defined(_WIN_32) && !defined(_LINUX)
+#if !defined(_WIN_32) && !defined(TARGET_POSIX)
clearerr(hFile);
#endif
if (Written<(unsigned int)Size && Written>0)
@@ -485,7 +485,7 @@ bool File::RawSeek(Int64 Offset,int Method)
Offset=(Method==SEEK_CUR ? Tell():FileLength())+Offset;
Method=SEEK_SET;
}*/
-#if defined(_WIN_32) || defined(_LINUX)
+#if defined(_WIN_32) || defined(TARGET_POSIX)
//LONG HighDist=int64to32(Offset>>32);
//if (SetFilePointer(hFile,int64to32(Offset),&HighDist,Method)==0xffffffff &&
if (Offset > FileLength())
@@ -510,7 +510,7 @@ bool File::RawSeek(Int64 Offset,int Method)
Int64 File::Tell()
{
-#if defined(_WIN_32) || defined(_LINUX)
+#if defined(_WIN_32) || defined(TARGET_POSIX)
//LONG HighDist=0;
//uint LowDist=SetFilePointer(hFile,0,&HighDist,FILE_CURRENT);
//Int64 pos = m_File.GetPosition();
@@ -620,7 +620,7 @@ void File::SetCloseFileTimeByName(const char *Name,RarTime *ftm,RarTime *fta)
void File::GetOpenFileTime(RarTime *ft)
{
-#if defined(_WIN_32) || defined(_LINUX)
+#if defined(_WIN_32) || defined(TARGET_POSIX)
/* FILETIME FileTime;
GetFileTime(hFile,NULL,NULL,&FileTime);
*ft=FileTime;*/
@@ -675,7 +675,7 @@ bool File::IsDevice()
{
/*if (hFile==BAD_HANDLE)
return(false);*/
-#if defined(_XBOX) || defined(_LINUX) || defined(_XBMC)
+#if defined(_XBOX) || defined(TARGET_POSIX) || defined(_XBMC)
return false;
//#ifdef _WIN_32
#elif defined(_WIN_32)
View
16 lib/UnrarXLib/filefn.cpp
@@ -1,5 +1,5 @@
#include "rar.hpp"
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include "XFileUtils.h"
#endif
@@ -34,7 +34,7 @@ void SetDirTime(const char *Name,RarTime *ftm,RarTime *ftc,RarTime *fta)
bool IsRemovable(const char *Name)
{
-#if defined(_LINUX)
+#if defined(TARGET_POSIX)
return false;
//#ifdef _WIN_32
#elif defined(_WIN_32)
@@ -54,7 +54,7 @@ bool IsRemovable(const char *Name)
#ifndef SFX_MODULE
Int64 GetFreeDisk(const char *Name)
{
-#if defined(_LINUX)
+#if defined(TARGET_POSIX)
char Root[NM];
GetPathRoot(Name,Root);
@@ -146,7 +146,7 @@ Int64 GetFreeDisk(const char *Name)
bool FileExist(const char *Name,const wchar *NameW)
{
#ifdef _WIN_32
-#if !defined(_LINUX)
+#if !defined(TARGET_POSIX)
if (WinNT() && NameW!=NULL && *NameW!=0)
return(GetFileAttributesW(NameW)!=0xffffffff);
else
@@ -242,7 +242,7 @@ void PrepareToDelete(const char *Name,const wchar *NameW)
uint GetFileAttr(const char *Name,const wchar *NameW)
{
#ifdef _WIN_32
-#if !defined(_LINUX)
+#if !defined(TARGET_POSIX)
if (WinNT() && NameW!=NULL && *NameW!=0)
return(GetFileAttributesW(NameW));
else
@@ -267,7 +267,7 @@ bool SetFileAttr(const char *Name,const wchar *NameW,uint Attr)
{
bool success;
#ifdef _WIN_32
-#if !defined(_LINUX)
+#if !defined(TARGET_POSIX)
if (WinNT() && NameW!=NULL && *NameW!=0)
success=SetFileAttributesW(NameW,Attr)!=0;
else
@@ -290,7 +290,7 @@ void ConvertNameToFull(const char *Src,char *Dest)
{
#ifdef _WIN_32
//#ifndef _WIN_CE
-#if !defined(_WIN_CE) && !defined(_LINUX)
+#if !defined(_WIN_CE) && !defined(TARGET_POSIX)
char FullName[NM],*NamePtr;
if (GetFullPathName(Src,sizeof(FullName),FullName,&NamePtr))
strcpy(Dest,FullName);
@@ -329,7 +329,7 @@ void ConvertNameToFull(const wchar *Src,wchar *Dest)
#endif
{
//#ifndef _WIN_CE
-#if !defined(_WIN_CE) && !defined(_LINUX)
+#if !defined(_WIN_CE) && !defined(TARGET_POSIX)
wchar FullName[NM],*NamePtr;
if (GetFullPathNameW(Src,sizeof(FullName)/sizeof(FullName[0]),FullName,&NamePtr))
strcpyw(Dest,FullName);
View
2  lib/UnrarXLib/filestr.cpp
@@ -113,7 +113,7 @@ bool ReadTextFile(char *Name,StringList *List,bool Config,bool AbortOnError,
CurStr++;
}
}
-#if defined(_WIN_32) && !defined(_LINUX)
+#if defined(_WIN_32) && !defined(TARGET_POSIX)
if (ConvertToAnsi)
OemToChar(CurStr,CurStr);
#endif
View
2  lib/UnrarXLib/find.cpp
@@ -183,7 +183,7 @@ bool FindFile::FastFind(const char *FindMask,const wchar *FindMaskW,struct FindD
#ifdef _WIN_32
HANDLE FindFile::Win32Find(HANDLE hFind,const char *Mask,const wchar *MaskW,struct FindData *fd)
{
-#if !defined(_LINUX)
+#if !defined(TARGET_POSIX)
#ifndef _WIN_CE
if (WinNT())
#endif
View
4 lib/UnrarXLib/os.hpp
@@ -1,7 +1,7 @@
#ifndef _RAR_OS_
#define _RAR_OS_
-#ifdef WIN32
+#ifdef TARGET_WINDOWS
#include <windows.h>
#endif
@@ -38,7 +38,7 @@
#include "system.h"
#include <prsht.h>
-#if defined(_LINUX)
+#if defined(TARGET_POSIX)
#include "PlatformDefs.h"
#endif
View
2  lib/UnrarXLib/pathfn.cpp
@@ -343,7 +343,7 @@ bool EnumConfigPaths(char *Path,int Number)
#elif defined(_WIN_32)
if (Number!=0)
return(false);
-#if !defined(_LINUX)
+#if !defined(TARGET_POSIX)
GetModuleFileName(NULL,Path,NM);
RemoveNameFromPath(Path);
#endif
View
4 lib/UnrarXLib/rar.cpp
@@ -13,7 +13,7 @@ extern "C" char **__crt0_glob_function (char *arg) { return 0; }
extern "C" void __crt0_load_environment_file (char *progname) { }
#endif
-#if !defined(GUI) && !defined(RARDLL) && !defined(_LINUX) && !defined(_XBMC)
+#if !defined(GUI) && !defined(RARDLL) && !defined(TARGET_POSIX) && !defined(_XBMC)
int main(int argc, char *argv[])
{
#ifdef _UNIX
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
#endif
-#if defined(_LINUX) || defined(_XBMC)
+#if defined(TARGET_POSIX) || defined(_XBMC)
/*-------------------------------------------------------------------------*\
XBOX interface
\*-------------------------------------------------------------------------*/
View
4 lib/UnrarXLib/suballoc.hpp
@@ -11,13 +11,13 @@ const int N1=4, N2=4, N3=4, N4=(128+3-1*N1-2*N2-3*N3)/4;
const int N_INDEXES=N1+N2+N3+N4;
// FIXME, this is probably broken on OS X.
-#if (defined(__GNUC__) || defined(_LINUX)) && !defined(__APPLE__)
+#if (defined(__GNUC__) || defined(TARGET_POSIX)) && !defined(TARGET_DARWIN)
#define _PACK_ATTR __attribute__ ((__packed__))
#else
#define _PACK_ATTR
#endif /* defined(__GNUC__) */
-#ifndef _LINUX
+#ifndef TARGET_POSIX
#pragma pack(1)
#endif
struct RAR_MEM_BLK
View
2  lib/UnrarXLib/unicode.cpp
@@ -367,7 +367,7 @@ SupportDBCS::SupportDBCS()
void SupportDBCS::Init()
{
-#if defined(_LINUX)
+#if defined(TARGET_POSIX)
DBCSMode = true;
for (int I=0;I<sizeof(IsLeadByte)/sizeof(IsLeadByte[0]);I++)
IsLeadByte[I]=true;
View
2  lib/libRTV/rtv.h
@@ -39,7 +39,7 @@ typedef unsigned __int64 u64;
typedef __int64 s64;
#define U64F "I64"
#endif
-#ifdef _LINUX
+#ifndef _WIN32
typedef unsigned long long u64;
typedef signed long long s64;
#define U64F "l"
View
11 lib/libXDAAP/private.h
@@ -61,11 +61,6 @@ struct DAAP_SClientTAG
#endif
HTTP_ConnectionWatch *update_watch;
-
-#if !defined(WIN32) && !defined(_LINUX)
- // why is this here?
- SDiscover *discover;
-#endif
};
typedef struct
@@ -133,14 +128,14 @@ struct SDiscoverTAG
and tests it for death */
ts_mutex mtWorkerLock;
-#ifndef _LINUX
+#ifdef _WIN32
fnDiscUpdated pfnUpdateCallback;
#endif
void *pvCallbackArg;
struct CP_SThreadPool *tp;
-#ifndef _LINUX
+#ifdef _WIN32
mdnsd mdnsd_info;
#endif
int socket;
@@ -149,7 +144,7 @@ struct SDiscoverTAG
// answers
/* answers */
int pending_hosts;
-#ifndef _LINUX
+#ifdef _WIN32
SDiscover_HostList *prenamed;
SDiscover_HostList *pending;
SDiscover_HostList *have;
View
44 xbmc/Application.cpp
@@ -105,7 +105,7 @@
#include <SDL/SDL.h>
#endif
-#if defined(FILESYSTEM) && !defined(_LINUX)
+#if defined(FILESYSTEM) && !defined(TARGET_POSIX)
#include "filesystem/FileDAAP.h"
#endif
#ifdef HAS_UPNP
@@ -113,7 +113,7 @@
#include "network/upnp/UPnPSettings.h"
#include "filesystem/UPnPDirectory.h"
#endif
-#if defined(_LINUX) && defined(HAS_FILESYSTEM_SMB)
+#if defined(TARGET_POSIX) && defined(HAS_FILESYSTEM_SMB)
#include "filesystem/SMBDirectory.h"
#endif
#ifdef HAS_FILESYSTEM_NFS
@@ -136,7 +136,7 @@
#endif
#include "network/Zeroconf.h"
#include "network/ZeroconfBrowser.h"
-#ifndef _LINUX
+#ifndef TARGET_POSIX
#include "threads/platform/win/Win32Exception.h"
#endif
#ifdef HAS_EVENT_SERVER
@@ -320,7 +320,7 @@
#include "settings/SkinSettings.h"
#include "view/ViewStateSettings.h"
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include "XHandle.h"
#endif
@@ -598,14 +598,14 @@ bool CApplication::Create()
g_graphicsContext.ResetOverscan((RESOLUTION)i, CDisplaySettings::Get().GetResolutionInfo(i).Overscan);
}
-#ifdef _LINUX
+#ifdef TARGET_POSIX
tzset(); // Initialize timezone information variables
#endif
// Grab a handle to our thread to be used later in identifying the render thread.
m_threadID = CThread::GetCurrentThreadId();
-#ifndef _LINUX
+#ifndef TARGET_POSIX
//floating point precision to 24 bits (faster performance)
_controlfp(_PC_24, _MCW_PC);
@@ -645,11 +645,11 @@ bool CApplication::Create()
CLog::Log(LOGNOTICE, "Starting XBMC (%s), Platform: Darwin OSX (%s). Built on %s", g_infoManager.GetVersion().c_str(), g_sysinfo.GetUnameVersion().c_str(), __DATE__);
#elif defined(TARGET_DARWIN_IOS)
CLog::Log(LOGNOTICE, "Starting XBMC (%s), Platform: Darwin iOS (%s). Built on %s", g_infoManager.GetVersion().c_str(), g_sysinfo.GetUnameVersion().c_str(), __DATE__);
-#elif defined(__FreeBSD__)
+#elif defined(TARGET_FREEBSD)
CLog::Log(LOGNOTICE, "Starting XBMC (%s), Platform: FreeBSD (%s). Built on %s", g_infoManager.GetVersion().c_str(), g_sysinfo.GetUnameVersion().c_str(), __DATE__);
-#elif defined(_LINUX)
+#elif defined(TARGET_POSIX)
CLog::Log(LOGNOTICE, "Starting XBMC (%s), Platform: Linux (%s, %s). Built on %s", g_infoManager.GetVersion().c_str(), g_sysinfo.GetLinuxDistro().c_str(), g_sysinfo.GetUnameVersion().c_str(), __DATE__);
-#elif defined(_WIN32)
+#elif defined(TARGET_WINDOWS)
CLog::Log(LOGNOTICE, "Starting XBMC (%s), Platform: %s. Built on %s (compiler %i)", g_infoManager.GetVersion().c_str(), g_sysinfo.GetKernelVersion().c_str(), __DATE__, _MSC_VER);
CLog::Log(LOGNOTICE, g_cpuInfo.getCPUModel().c_str());
CLog::Log(LOGNOTICE, CWIN32Util::GetResInfoString());
@@ -694,9 +694,9 @@ bool CApplication::Create()
// for python scripts that check the OS
#if defined(TARGET_DARWIN)
setenv("OS","OS X",true);
-#elif defined(_LINUX)
+#elif defined(TARGET_POSIX)
setenv("OS","Linux",true);
-#elif defined(_WIN32)
+#elif defined(TARGET_WINDOWS)
CEnvironment::setenv("OS", "win32");
#endif
@@ -839,13 +839,13 @@ bool CApplication::CreateGUI()
//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(TARGET_DARWIN)
+#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN)
setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
#endif
#endif // HAS_SDL
-#ifdef _LINUX
+#ifdef TARGET_POSIX
// for nvidia cards - vsync currently ALWAYS enabled.
// the reason is that after screen has been setup changing this env var will make no difference.
setenv("__GL_SYNC_TO_VBLANK", "1", 0);
@@ -990,7 +990,7 @@ bool CApplication::InitDirectoriesLinux()
might be mixed case.
*/
-#if defined(_LINUX) && !defined(TARGET_DARWIN)
+#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN)
CStdString userName;
if (getenv("USER"))
userName = getenv("USER");
@@ -1164,7 +1164,7 @@ bool CApplication::InitDirectoriesOSX()
bool CApplication::InitDirectoriesWin32()
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
CStdString xbmcPath;
CUtil::GetHomePath(xbmcPath);
@@ -1207,12 +1207,12 @@ void CApplication::CreateUserDirs()
bool CApplication::Initialize()
{
-#if defined(HAS_DVD_DRIVE) && !defined(_WIN32) // somehow this throws an "unresolved external symbol" on win32
+#if defined(HAS_DVD_DRIVE) && !defined(TARGET_WINDOWS) // somehow this throws an "unresolved external symbol" on win32
// turn off cdio logging
cdio_loglevel_default = CDIO_LOG_ERROR;
#endif
-#ifdef _LINUX // TODO: Win32 has no special://home/ mapping by default, so we
+#ifdef TARGET_POSIX // TODO: Win32 has no special://home/ mapping by default, so we
// must create these here. Ideally this should be using special://home/ and
// be platform agnostic (i.e. unify the InitDirectories*() functions)
if (!m_bPlatformDirectories)
@@ -1511,7 +1511,7 @@ void CApplication::StopPVRManager()
void CApplication::StartServices()
{
-#if !defined(_WIN32) && defined(HAS_DVD_DRIVE)
+#if !defined(TARGET_WINDOWS) && defined(HAS_DVD_DRIVE)
// Start Thread for DVD Mediatype detection
CLog::Log(LOGNOTICE, "start dvd mediatype detection");
m_DetectDVDType.Create(false, THREAD_MINSTACKSIZE);
@@ -1529,7 +1529,7 @@ void CApplication::StopServices()
{
m_network->NetworkMessage(CNetwork::SERVICES_DOWN, 0);
-#if !defined(_WIN32) && defined(HAS_DVD_DRIVE)
+#if !defined(TARGET_WINDOWS) && defined(HAS_DVD_DRIVE)
CLog::Log(LOGNOTICE, "stop dvd detect media");
m_DetectDVDType.StopThread();
#endif
@@ -3260,7 +3260,7 @@ bool CApplication::Cleanup()
CSettings::Get().Uninitialize();
g_advancedSettings.Clear();
-#ifdef _LINUX
+#ifdef TARGET_POSIX
CXHandle::DumpObjectTracker();
#ifdef HAS_DVD_DRIVE
@@ -3971,7 +3971,7 @@ PlayBackRet CApplication::PlayFile(const CFileItem& item, bool bRestart)
}
-#if !defined(TARGET_DARWIN) && !defined(_LINUX)
+#if !defined(TARGET_POSIX)
g_audioManager.Enable(false);
#endif
@@ -5021,7 +5021,7 @@ void CApplication::ProcessSlow()
UPNP::CUPnP::GetInstance()->UpdateState();
#endif
-#if defined(_LINUX) && defined(HAS_FILESYSTEM_SMB)
+#if defined(TARGET_POSIX) && defined(HAS_FILESYSTEM_SMB)
smb.CheckIfIdle();
#endif
View
8 xbmc/Application.h
@@ -52,10 +52,10 @@ class CPlayerController;
#include "settings/ISettingsHandler.h"
#include "settings/ISettingCallback.h"
#include "settings/ISubSettings.h"
-#if !defined(_WIN32) && defined(HAS_DVD_DRIVE)
+#if !defined(TARGET_WINDOWS) && defined(HAS_DVD_DRIVE)
#include "storage/DetectDVDType.h"
#endif
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include "win32/WIN32Util.h"
#endif
#include "utils/Stopwatch.h"
@@ -269,7 +269,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
MEDIA_DETECT::CAutorun* m_Autorun;
#endif
-#if !defined(_WIN32) && defined(HAS_DVD_DRIVE)
+#if !defined(TARGET_WINDOWS) && defined(HAS_DVD_DRIVE)
MEDIA_DETECT::CDetectDVDMedia m_DetectDVDType;
#endif
@@ -382,7 +382,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
ADDON::AddonPtr m_screenSaver;
// timer information
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
CWinIdleTimer m_idleTimer;
CWinIdleTimer m_screenSaverTimer;
#else
View
6 xbmc/ApplicationMessenger.cpp
@@ -49,7 +49,7 @@
#include "powermanagement/PowerManager.h"
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include "WIN32Util.h"
#define CHalManager CWIN32Util
#elif defined(TARGET_DARWIN)
@@ -546,9 +546,9 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg)
{
CLog::Log(LOGNOTICE, "%s: Failed to suspend AudioEngine before launching external program",__FUNCTION__);
}
-#if defined( _LINUX) && !defined(TARGET_DARWIN)
+#if defined( TARGET_POSIX) && !defined(TARGET_DARWIN)
CUtil::RunCommandLine(pMsg->strParam.c_str(), (pMsg->dwParam1 == 1));
-#elif defined(_WIN32)
+#elif defined(TARGET_WINDOWS)
CWIN32Util::XBMCShellExecute(pMsg->strParam.c_str(), (pMsg->dwParam1 == 1));
#endif
/* Resume AE processing of XBMC native audio */
View
4 xbmc/Autorun.cpp
@@ -104,7 +104,7 @@ bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startF
if (mediaPath.IsEmpty())
mediaPath = path;
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
if (mediaPath.IsEmpty() || mediaPath.CompareNoCase("iso9660://") == 0)
mediaPath = g_mediaManager.TranslateDevicePath("");
#endif
@@ -455,7 +455,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
void CAutorun::HandleAutorun()
{
-#ifndef _WIN32
+#ifndef TARGET_WINDOWS
if (!m_bEnable)
{
CDetectDVDMedia::m_evAutorun.Reset();
View
2  xbmc/BackgroundInfoLoader.cpp
@@ -136,7 +136,7 @@ void CBackgroundInfoLoader::Load(CFileItemList& items)
{
CThread *pThread = new CThread(this, "BackgroundLoader");
pThread->Create();
-#ifndef _LINUX
+#ifndef TARGET_POSIX
pThread->SetPriority(THREAD_PRIORITY_BELOW_NORMAL);
#endif
m_workers.push_back(pThread);
View
4 xbmc/DllPaths.h
@@ -21,9 +21,9 @@
*
*/
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include "DllPaths_win32.h"
-#elif defined (__ANDROID__)
+#elif defined (TARGET_ANDROID)
#include "DllPaths_generated_android.h"
#else
#include "DllPaths_generated.h"
View
6 xbmc/DllPaths_generated.h.in
@@ -88,10 +88,10 @@
#define DLL_PATH_VORBIS "@VORBIS_SONAME@"
/* broadcom crystalhd */
-#if defined(_LINUX) && !defined(__APPLE__)
-#define DLL_PATH_LIBCRYSTALHD "@CRYSTALHD_SONAME@"
-#else
+#if defined(TARGET_DARWIN)
#define DLL_PATH_LIBCRYSTALHD "libcrystalhd.dylib"
+#else
+#define DLL_PATH_LIBCRYSTALHD "@CRYSTALHD_SONAME@"
#endif
/* libbluray */
View
8 xbmc/GUIInfoManager.cpp
@@ -2113,13 +2113,13 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
bReturn = g_application.IsMusicScanning();
}
else if (condition == SYSTEM_PLATFORM_LINUX)
-#if defined(_LINUX) && !defined(TARGET_DARWIN) && !defined(TARGET_ANDROID)
+#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
bReturn = true;
#else
bReturn = false;
#endif
else if (condition == SYSTEM_PLATFORM_WINDOWS)
-#ifdef WIN32
+#ifdef TARGET_WINDOWS
bReturn = true;
#else
bReturn = false;
@@ -3959,7 +3959,7 @@ string CGUIInfoManager::GetSystemHeatInfo(int info)
if (CTimeUtils::GetFrameTime() - m_lastSysHeatInfoTime >= SYSHEATUPDATEINTERVAL)
{ // update our variables
m_lastSysHeatInfoTime = CTimeUtils::GetFrameTime();
-#if defined(_LINUX)
+#if defined(TARGET_POSIX)
g_cpuInfo.getTemperature(m_cpuTemp);
m_gpuTemp = GetGPUTemperature();
#endif
@@ -3978,7 +3978,7 @@ string CGUIInfoManager::GetSystemHeatInfo(int info)
text.Format("%i%%", m_fanSpeed * 2);
break;
case SYSTEM_CPU_USAGE:
-#if defined(TARGET_DARWIN) || defined(_WIN32)
+#if defined(TARGET_DARWIN) || defined(TARGET_WINDOWS)
text.Format("%d%%", g_cpuInfo.getUsedPercentage());
#else
text.Format("%s", g_cpuInfo.GetCoresUsageString());
View
8 xbmc/LangInfo.cpp
@@ -156,7 +156,7 @@ void CLangInfo::CRegion::SetGlobalLocale()
if (m_strRegionLocaleName.length() > 0)
{
strLocale = m_strLangLocaleName + "_" + m_strRegionLocaleName;
-#ifdef _LINUX
+#ifdef TARGET_POSIX
strLocale += ".UTF-8";
#endif
}
@@ -167,7 +167,7 @@ void CLangInfo::CRegion::SetGlobalLocale()
// decimal separator is changed depending of the current language
// (ie. "," in French or Dutch instead of "."). This breaks atof() and
// others similar functions.
-#if defined(__FreeBSD__) || defined(TARGET_DARWIN_OSX)
+#if defined(TARGET_FREEBSD) || defined(TARGET_DARWIN_OSX)
// on FreeBSD and darwin libstdc++ is compiled with "generic" locale support
if (setlocale(LC_COLLATE, strLocale.c_str()) == NULL
|| setlocale(LC_CTYPE, strLocale.c_str()) == NULL)
@@ -250,7 +250,7 @@ bool CLangInfo::Load(const CStdString& strFileName)
if (pRootElement->Attribute("locale"))
m_defaultRegion.m_strLangLocaleName = pRootElement->Attribute("locale");
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
// Windows need 3 chars isolang code
if (m_defaultRegion.m_strLangLocaleName.length() == 2)
{
@@ -319,7 +319,7 @@ bool CLangInfo::Load(const CStdString& strFileName)
if (pRegion->Attribute("locale"))
region.m_strRegionLocaleName = pRegion->Attribute("locale");
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
// Windows need 3 chars regions code
if (region.m_strRegionLocaleName.length() == 2)
{
View
6 xbmc/URL.cpp
@@ -27,7 +27,7 @@
#include "FileItem.h"
#include "filesystem/StackDirectory.h"
#include "addons/Addon.h"
-#ifndef _LINUX
+#ifndef TARGET_POSIX
#include <sys\types.h>
#include <sys\stat.h>
#endif
@@ -120,7 +120,7 @@ void CURL::Parse(const CStdString& strURL1)
struct __stat64 s;
if (XFILE::CFile::Stat(archiveName, &s) == 0)
{
-#ifdef _LINUX
+#ifdef TARGET_POSIX
if (!S_ISDIR(s.st_mode))
#else
if (!(s.st_mode & S_IFDIR))
@@ -501,7 +501,7 @@ const CStdString CURL::GetFileNameWithoutPath() const
char CURL::GetDirectorySeparator() const
{
-#ifndef _LINUX
+#ifndef TARGET_POSIX
if ( IsLocal() )
return '\\';
else
View
2  xbmc/URL.h
@@ -22,7 +22,7 @@
#include "utils/StdString.h"
#include "utils/UrlOptions.h"
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#undef SetPort // WIN32INCLUDES this is defined as SetPortA in WinSpool.h which is being included _somewhere_
#endif
View
44 xbmc/Util.cpp
@@ -25,12 +25,12 @@
#include <mach-o/dyld.h>
#endif
-#if defined(__FreeBSD__)
+#if defined(TARGET_FREEBSD)
#include <sys/param.h>
#include <sys/sysctl.h>
#endif
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include <sys/types.h>
#include <dirent.h>
#include <unistd.h>
@@ -63,7 +63,7 @@
#include "guilib/TextureManager.h"
#include "utils/fstrcmp.h"
#include "storage/MediaManager.h"
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include "utils/CharsetConverter.h"
#include <shlobj.h>
#include "WIN32Util.h"
@@ -316,7 +316,7 @@ void CUtil::GetQualifiedFilename(const CStdString &strBasePath, CStdString &strF
// If the filename starts "x:", "\\" or "/" it's already fully qualified so return
if (strFilename.size() > 1)
-#ifdef _LINUX
+#ifdef TARGET_POSIX
if ( (strFilename[1] == ':') || (strFilename[0] == '/') )
#else
if ( strFilename[1] == ':' || (strFilename[0] == '\\' && strFilename[1] == '\\'))
@@ -365,7 +365,7 @@ bool CUtil::TestGetQualifiedFilename()
bool CUtil::TestMakeLegalPath()
{
CStdString path;
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
path = "C:\\foo\\bar"; path = MakeLegalPath(path);
if (path != "C:\\foo\\bar") return false;
path = "C:\\foo:\\bar\\"; path = MakeLegalPath(path);
@@ -396,7 +396,7 @@ void CUtil::GetHomePath(CStdString& strPath, const CStdString& strTarget)
if (!strPath.IsEmpty())
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
char tmp[1024];
//expand potential relative path to full path
if(GetFullPathName(strPath, 1024, tmp, 0) != 0)
@@ -442,7 +442,7 @@ void CUtil::GetHomePath(CStdString& strPath, const CStdString& strTarget)
strPath = strHomePath;
}
-#if defined(_LINUX) && !defined(TARGET_DARWIN)
+#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN)
/* Change strPath accordingly when target is XBMC_HOME and when INSTALL_PATH
* and BIN_INSTALL_PATH differ
*/
@@ -773,7 +773,7 @@ void CUtil::StatToStatI64(struct _stati64 *result, struct stat *stat)
result->st_rdev = stat->st_rdev;
result->st_size = (int64_t)stat->st_size;
-#ifndef _LINUX
+#ifndef TARGET_POSIX
result->st_atime = (long)(stat->st_atime & 0xFFFFFFFF);
result->st_mtime = (long)(stat->st_mtime & 0xFFFFFFFF);
result->st_ctime = (long)(stat->st_ctime & 0xFFFFFFFF);
@@ -794,7 +794,7 @@ void CUtil::Stat64ToStatI64(struct _stati64 *result, struct __stat64 *stat)
result->st_gid = stat->st_gid;
result->st_rdev = stat->st_rdev;
result->st_size = stat->st_size;
-#ifndef _LINUX
+#ifndef TARGET_POSIX
result->st_atime = (long)(stat->st_atime & 0xFFFFFFFF);
result->st_mtime = (long)(stat->st_mtime & 0xFFFFFFFF);
result->st_ctime = (long)(stat->st_ctime & 0xFFFFFFFF);
@@ -815,7 +815,7 @@ void CUtil::StatI64ToStat64(struct __stat64 *result, struct _stati64 *stat)
result->st_gid = stat->st_gid;
result->st_rdev = stat->st_rdev;
result->st_size = stat->st_size;
-#ifndef _LINUX
+#ifndef TARGET_POSIX
result->st_atime = stat->st_atime;
result->st_mtime = stat->st_mtime;
result->st_ctime = stat->st_ctime;
@@ -835,7 +835,7 @@ void CUtil::Stat64ToStat(struct stat *result, struct __stat64 *stat)
result->st_uid = stat->st_uid;
result->st_gid = stat->st_gid;
result->st_rdev = stat->st_rdev;
-#ifndef _LINUX
+#ifndef TARGET_POSIX
if (stat->st_size <= LONG_MAX)
result->st_size = (_off_t)stat->st_size;
#else
@@ -852,7 +852,7 @@ void CUtil::Stat64ToStat(struct stat *result, struct __stat64 *stat)
result->st_ctime = (time_t)(stat->st_ctime & 0xFFFFFFFF);
}
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
void CUtil::Stat64ToStat64i32(struct _stat64i32 *result, struct __stat64 *stat)
{
result->st_dev = stat->st_dev;
@@ -862,7 +862,7 @@ void CUtil::Stat64ToStat64i32(struct _stat64i32 *result, struct __stat64 *stat)
result->st_uid = stat->st_uid;
result->st_gid = stat->st_gid;
result->st_rdev = stat->st_rdev;
-#ifndef _LINUX
+#ifndef TARGET_POSIX
if (stat->st_size <= LONG_MAX)
result->st_size = (_off_t)stat->st_size;
#else
@@ -874,7 +874,7 @@ void CUtil::Stat64ToStat64i32(struct _stat64i32 *result, struct __stat64 *stat)
result->st_size = 0;
CLog::Log(LOGWARNING, "WARNING: File is larger than 32bit stat can handle, file size will be reported as 0 bytes");
}
-#ifndef _LINUX
+#ifndef TARGET_POSIX
result->st_atime = stat->st_atime;
result->st_mtime = stat->st_mtime;
result->st_ctime = stat->st_ctime;
@@ -981,7 +981,7 @@ CStdString CUtil::ValidatePath(const CStdString &path, bool bFixDoubleSlashes /*
return result;
// check the path for incorrect slashes
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
if (URIUtils::IsDOSPath(path))
{
result.Replace('/', '\\');
@@ -1585,7 +1585,7 @@ void CUtil::InitRandomSeed()
srand(seed);
}
-#ifdef _LINUX
+#ifdef TARGET_POSIX
bool CUtil::RunCommandLine(const CStdString& cmdLine, bool waitExit)
{
CStdStringArray args;
@@ -1808,7 +1808,7 @@ int CUtil::TranslateRomanNumeral(const char* roman_numeral)
CStdString CUtil::ResolveExecutablePath()
{
CStdString strExecutablePath;
-#ifdef WIN32
+#ifdef TARGET_WINDOWS
wchar_t szAppPathW[MAX_PATH] = L"";
::GetModuleFileNameW(0, szAppPathW, sizeof(szAppPathW)/sizeof(szAppPathW[0]) - 1);
CStdStringW strPathW = szAppPathW;
@@ -1819,7 +1819,7 @@ CStdString CUtil::ResolveExecutablePath()
GetDarwinExecutablePath(given_path, &path_size);
strExecutablePath = given_path;
-#elif defined(__FreeBSD__)
+#elif defined(TARGET_FREEBSD)
char buf[PATH_MAX];
size_t buflen;
int mib[4];
@@ -2200,7 +2200,7 @@ bool CUtil::IsVobSub( const std::vector<CStdString>& vecSubtitles, const CStdStr
bool CUtil::CanBindPrivileged()
{
-#ifdef _LINUX
+#ifdef TARGET_POSIX
if (geteuid() == 0)
return true; //root user can always bind to privileged ports
@@ -2227,17 +2227,17 @@ bool CUtil::CanBindPrivileged()
#endif //HAVE_LIBCAP
-#else //_LINUX
+#else //TARGET_POSIX
return true;
-#endif //_LINUX
+#endif //TARGET_POSIX
}
bool CUtil::ValidatePort(int port)
{
// check that it's a valid port
-#ifdef _LINUX
+#ifdef TARGET_POSIX
if (!CUtil::CanBindPrivileged() && (port < 1024 || port > 65535))
return false;
else
View
6 xbmc/Util.h
@@ -96,12 +96,12 @@ class CUtil
static void Stat64ToStatI64(struct _stati64 *result, struct __stat64 *stat);
static void StatI64ToStat64(struct __stat64 *result, struct _stati64 *stat);
static void Stat64ToStat(struct stat *result, struct __stat64 *stat);
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
static void Stat64ToStat64i32(struct _stat64i32 *result, struct __stat64 *stat);
#endif
static bool CreateDirectoryEx(const CStdString& strPath);
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
static CStdString MakeLegalFileName(const CStdString &strFile, int LegalType=LEGAL_WIN32_COMPAT);
static CStdString MakeLegalPath(const CStdString &strPath, int LegalType=LEGAL_WIN32_COMPAT);
#else
@@ -175,7 +175,7 @@ class CUtil
// return -1 on error, valid range is 1-3999
static int TranslateRomanNumeral(const char* roman_numeral);
-#ifdef _LINUX
+#ifdef TARGET_POSIX
// this will run the command using sudo in a new process.
// the user that runs xbmc should be allowed to issue the given sudo command.
// in order to allow a user to run sudo without supplying the password you'll need to edit sudoers
View
2  xbmc/addons/Addon.cpp
@@ -27,7 +27,7 @@
#if defined(TARGET_DARWIN)
#include "../osx/OSXGNUReplacements.h"
#endif
-#ifdef __FreeBSD__
+#ifdef TARGET_FREEBSD
#include "freebsd/FreeBSDGNUReplacements.h"
#endif
#include "utils/log.h"
View
6 xbmc/addons/AddonDll.h
@@ -94,11 +94,11 @@ CAddonDll<TheDll, TheStruct, TheProps>::CAddonDll(const cp_extension_t *ext)
{
#if defined(TARGET_ANDROID)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_android");
-#elif defined(_LINUX) && !defined(TARGET_DARWIN)
+#elif defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_linux");
-#elif defined(_WIN32) && defined(HAS_SDL_OPENGL)
+#elif defined(TARGET_WINDOWS) && defined(HAS_SDL_OPENGL)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_wingl");
-#elif defined(_WIN32) && defined(HAS_DX)
+#elif defined(TARGET_WINDOWS) && defined(HAS_DX)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_windx");
#elif defined(TARGET_DARWIN)
m_strLibName = CAddonMgr::Get().GetExtValue(ext->configuration, "@library_osx");
View
12 xbmc/addons/AddonManager.cpp
@@ -131,13 +131,13 @@ AddonPtr CAddonMgr::Factory(const cp_extension_t *props)
#if defined(TARGET_ANDROID)
if ((value = GetExtValue(props->plugin->extensions->configuration, "@library_android")) && value.empty())
break;
- #elif defined(_LINUX) && !defined(TARGET_DARWIN)
+#elif defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
if ((value = GetExtValue(props->plugin->extensions->configuration, "@library_linux")) && value.empty())
break;
-#elif defined(_WIN32) && defined(HAS_SDL_OPENGL)
+#elif defined(TARGET_WINDOWS) && defined(HAS_SDL_OPENGL)
if ((value = GetExtValue(props->plugin->extensions->configuration, "@library_wingl")) && value.empty())
break;
-#elif defined(_WIN32) && defined(HAS_DX)
+#elif defined(TARGET_WINDOWS) && defined(HAS_DX)
if ((value = GetExtValue(props->plugin->extensions->configuration, "@library_windx")) && value.empty())
break;
#elif defined(TARGET_DARWIN)
@@ -651,11 +651,11 @@ bool CAddonMgr::PlatformSupportsAddon(const cp_plugin_info_t *plugin) const
return true;
#if defined(TARGET_ANDROID)
if (platforms[i] == "android")
-#elif defined(_LINUX) && !defined(TARGET_DARWIN)
+#elif defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
if (platforms[i] == "linux")
-#elif defined(_WIN32) && defined(HAS_SDL_OPENGL)
+#elif defined(TARGET_WINDOWS) && defined(HAS_SDL_OPENGL)
if (platforms[i] == "wingl")
-#elif defined(_WIN32) && defined(HAS_DX)
+#elif defined(TARGET_WINDOWS) && defined(HAS_DX)
if (platforms[i] == "windx")
#elif defined(TARGET_DARWIN_OSX)
// Remove this after Frodo and add an architecture filter
View
2  xbmc/addons/Visualisation.cpp
@@ -33,7 +33,7 @@
#include "cores/IPlayer.h"
#include "cores/AudioEngine/AEFactory.h"
#include "cores/AudioEngine/Utils/AEConvert.h"
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include <dlfcn.h>
#include "filesystem/SpecialProtocol.h"
#endif
View
2  xbmc/addons/include/xbmc_addon_dll.h
@@ -21,7 +21,7 @@
*
*/
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include <windows.h>
#else
#ifndef __cdecl
View
2  xbmc/addons/include/xbmc_pvr_types.h
@@ -22,7 +22,7 @@
#ifndef __PVRCLIENT_TYPES_H__
#define __PVRCLIENT_TYPES_H__
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include <windows.h>
#else
#ifndef __cdecl
View
2  xbmc/cdrip/CDDARipJob.cpp
@@ -234,7 +234,7 @@ CEncoder* CCDDARipJob::SetupEncoder(CFile& reader)
CStdString CCDDARipJob::SetupTempFile()
{
char tmp[MAX_PATH];
-#ifndef _LINUX
+#ifndef TARGET_POSIX
GetTempFileName(CSpecialProtocol::TranslatePath("special://temp/"), "riptrack", 0, tmp);
#else
int fd;
View
2  xbmc/cdrip/CDDARipper.cpp
@@ -182,7 +182,7 @@ bool CCDDARipper::CreateAlbumDir(const MUSIC_INFO::CMusicInfoTag& infoTag, CStdS
CFileItem ripPath(strDirectory, true);
if (ripPath.IsSmb())
legalType = LEGAL_WIN32_COMPAT;
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
if (ripPath.IsHD())
legalType = LEGAL_WIN32_COMPAT;
#endif
View
2  xbmc/cdrip/DllOgg.h
@@ -20,7 +20,7 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
+#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS)
#include "config.h"
#endif
#include <ogg/ogg.h>
View
2  xbmc/cdrip/DllVorbis.h
@@ -20,7 +20,7 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
+#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS)
#include "config.h"
#endif
#include <vorbis/vorbisenc.h>
View
2  xbmc/cdrip/DllVorbisEnc.h
@@ -20,7 +20,7 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
+#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS)
#include "config.h"
#endif
#include <vorbis/vorbisenc.h>
View
2  xbmc/cdrip/EncoderFFmpeg.cpp
@@ -24,7 +24,7 @@
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include "stdint.h"
#else
#define INT64_C __int64
View
2  xbmc/cdrip/EncoderLame.cpp
@@ -22,7 +22,7 @@
#include "settings/Settings.h"
#include "utils/log.h"
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
extern "C" FILE *fopen_utf8(const char *_Filename, const char *_Mode);
#else
#define fopen_utf8 fopen
View
2  xbmc/cores/AudioEngine/Sinks/AESinkNULL.cpp
@@ -160,7 +160,7 @@ void CAESinkNULL::Process()
// an approximate sleep time.
int frames_written = read_bytes / m_sink_frameSize;
double empty_ms = 1000.0 * (double)frames_written / m_format.m_sampleRate;
- #if defined(_LINUX)
+ #if defined(TARGET_POSIX)
usleep(empty_ms * 1000.0);
#else
Sleep((int)empty_ms);
View
6 xbmc/cores/DllLoader/DllLoader.cpp
@@ -26,7 +26,7 @@
#include <limits>
#include "utils/log.h"
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
extern "C" FILE *fopen_utf8(const char *_Filename, const char *_Mode);
#else
#define fopen_utf8 fopen
@@ -49,7 +49,7 @@ extern "C" FILE *fopen_utf8(const char *_Filename, const char *_Mode);
typedef BOOL (APIENTRY *EntryFunc)(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
-#ifdef _LINUX
+#ifdef TARGET_POSIX
/*
* This is a dirty hack.
* The win32 DLLs contain an alloca routine, that first probes the soon
@@ -667,7 +667,7 @@ bool DllLoader::Load()
/* since we are handing execution over to unknown code, safeguard here */
try
{
-#ifdef _LINUX
+#ifdef TARGET_POSIX
extend_stack_for_dll_alloca();
#endif
initdll((HINSTANCE)hModule, DLL_PROCESS_ATTACH , 0); //call "DllMain" with DLL_PROCESS_ATTACH
View
10 xbmc/cores/DllLoader/DllLoaderContainer.cpp
@@ -19,10 +19,10 @@
*/
#include "DllLoaderContainer.h"
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include "SoLoader.h"
#endif
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include "Win32DllLoader.h"
#endif
#include "DllLoader.h"
@@ -142,7 +142,7 @@ LibraryLoader* DllLoaderContainer::FindModule(const char* sName, const char* sCu
{ // Has a path, just try to load
return LoadDll(sName, bLoadSymbols);
}
-#ifdef _LINUX
+#ifdef TARGET_POSIX
else if (strcmp(sName, "xbmc.so") == 0)
return LoadDll(sName, bLoadSymbols);
#endif
@@ -238,12 +238,12 @@ LibraryLoader* DllLoaderContainer::LoadDll(const char* sName, bool bLoadSymbols)
#endif
LibraryLoader* pLoader;
-#ifdef _LINUX
+#ifdef TARGET_POSIX
if (strstr(sName, ".so") != NULL || strstr(sName, ".vis") != NULL || strstr(sName, ".xbs") != NULL
|| strstr(sName, ".mvis") != NULL || strstr(sName, ".dylib") != NULL || strstr(sName, ".framework") != NULL || strstr(sName, ".pvr") != NULL)
pLoader = new SoLoader(sName, bLoadSymbols);
else
-#elif defined(_WIN32)
+#elif defined(TARGET_WINDOWS)
if (1)
pLoader = new Win32DllLoader(sName);
else
View
2  xbmc/cores/DllLoader/LibraryLoader.h
@@ -22,7 +22,7 @@
#define LIBRARY_LOADER
#include "system.h"
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include "PlatformDefs.h"
#endif
View
2  xbmc/cores/DllLoader/SoLoader.h
@@ -23,7 +23,7 @@
#include <stdio.h>
#include "system.h"
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include "PlatformDefs.h"
#endif
#include "DllLoader.h"
View
4 xbmc/cores/DllLoader/coff.cpp
@@ -77,7 +77,7 @@ CoffLoader::~CoffLoader()
{
if ( hModule )
{
-#ifdef _LINUX
+#ifdef TARGET_POSIX
free(hModule);
#else
VirtualFree(hModule, 0, MEM_RELEASE);
@@ -209,7 +209,7 @@ int CoffLoader::LoadCoffHModule(FILE *fp)
return 0;
// alloc aligned memory
-#ifdef _LINUX
+#ifdef TARGET_POSIX
hModule = malloc(tempWindowsHeader.SizeOfImage);
#else
hModule = VirtualAllocEx(0, (PVOID)tempWindowsHeader.ImageBase, tempWindowsHeader.SizeOfImage, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
View
2  xbmc/cores/DllLoader/coff.h
@@ -350,7 +350,7 @@ typedef struct
}
SymbolTable_t;
-#if !defined(_WIN32)
+#if !defined(TARGET_WINDOWS)
#define IMAGE_SYM_UNDEFINED 0
#define IMAGE_SYM_ABSOLUTE 0xFFFF
View
2  xbmc/cores/DllLoader/dll.cpp
@@ -257,7 +257,7 @@ extern "C" DWORD WINAPI dllGetModuleFileNameA(HMODULE hModule, LPSTR lpFilename,
{
if (NULL == hModule)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
return GetModuleFileNameA(hModule, lpFilename, nSize);
#else
CLog::Log(LOGDEBUG, "%s - No hModule specified", __FUNCTION__);
View
6 xbmc/cores/DllLoader/dll_tracker.h
@@ -23,7 +23,7 @@
#include "threads/CriticalSection.h"
#include "PlatformDefs.h"
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include "system.h" // for SOCKET
#endif
@@ -128,7 +128,7 @@ DllTrackInfo* tracker_get_dlltrackinfo(uintptr_t caller);
void tracker_dll_data_track(DllLoader* pDll, uintptr_t addr);
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#define _ReturnAddress() __builtin_return_address(0)
#endif
@@ -136,7 +136,7 @@ void tracker_dll_data_track(DllLoader* pDll, uintptr_t addr);
}
#endif
-#ifndef _LINUX
+#ifndef TARGET_POSIX
extern "C" void * _ReturnAddress(void);
#pragma intrinsic(_ReturnAddress)
#endif
View
2  xbmc/cores/DllLoader/dll_tracker_file.cpp
@@ -24,7 +24,7 @@
#include "threads/SingleLock.h"
#include "utils/log.h"
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#define dll_open open
#define dll_fopen fopen
#define dll_close close
View
4 xbmc/cores/DllLoader/dll_util.cpp
@@ -21,7 +21,7 @@
#include "utils/log.h"
#include "dll_util.h"
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#include <windows.h>
#endif
#include <stdlib.h>
@@ -102,7 +102,7 @@ uintptr_t create_dummy_function(const char* strDllName, const char* strFunctionN
uintptr_t get_win_function_address(const char* strDllName, const char* strFunctionName)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
HMODULE handle = GetModuleHandle(strDllName);
if(handle == NULL)
{
View
56 xbmc/cores/DllLoader/exports/emu_kernel32.cpp
@@ -24,7 +24,7 @@
#include "storage/IoSupport.h"
-#ifndef _LINUX
+#ifndef TARGET_POSIX
#include <process.h>
#include "utils/CharsetConverter.h"
#endif
@@ -32,7 +32,7 @@
#include "../dll_tracker.h"
#include "filesystem/SpecialProtocol.h"
-#ifdef _LINUX
+#ifdef TARGET_POSIX
#include "../../../linux/PlatformInclude.h"
#define __except catch
#endif
@@ -82,7 +82,7 @@ extern "C" BOOL WINAPI dllFindClose(HANDLE hFile)
return FindClose(hFile);
}
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
#define CORRECT_SEP_STR(str) \
if (strstr(str, "://") == NULL) \
{ \
@@ -100,7 +100,7 @@ extern "C" BOOL WINAPI dllFindClose(HANDLE hFile)
#define CORRECT_SEP_STR(str)
#endif
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
static void to_WIN32_FIND_DATA(LPWIN32_FIND_DATAW wdata, LPWIN32_FIND_DATA data)
{
CStdString strname;
@@ -164,7 +164,7 @@ extern "C" HANDLE WINAPI dllFindFirstFileA(LPCTSTR lpFileName, LPWIN32_FIND_DATA
e[0] = '\0';
}
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
struct _WIN32_FIND_DATAW FindFileDataW;
CStdStringW strwfile;
g_charsetConverter.utf8ToW(CSpecialProtocol::TranslatePath(p), strwfile, false);
@@ -180,7 +180,7 @@ extern "C" HANDLE WINAPI dllFindFirstFileA(LPCTSTR lpFileName, LPWIN32_FIND_DATA
extern "C" BOOL WINAPI dllFindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATA lpFindFileData)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
struct _WIN32_FIND_DATAW FindFileDataW;
to_WIN32_FIND_DATAW(lpFindFileData, &FindFileDataW);
BOOL res = FindNextFileW(hFindFile, &FindFileDataW);
@@ -208,7 +208,7 @@ extern "C" DWORD WINAPI dllGetFileAttributesA(LPCSTR lpFileName)
}
else strcpy(str, lpFileName);
-#ifndef _LINUX
+#ifndef TARGET_POSIX
// convert '/' to '\\'
char *p = str;
while (p = strchr(p, '/')) * p = '\\';
@@ -225,7 +225,7 @@ extern "C" void WINAPI dllSleep(DWORD dwTime)
extern "C" DWORD WINAPI dllGetCurrentProcessId(void)
{
-#ifdef _LINUX
+#ifdef TARGET_POSIX
return (DWORD)getppid();
#else
return GetCurrentProcessId();
@@ -246,7 +246,7 @@ extern "C" int WINAPI dllDuplicateHandle(HANDLE hSourceProcessHandle, // handl
hSourceProcessHandle, hSourceHandle, hTargetProcessHandle,
lpTargetHandle, dwDesiredAccess, bInheritHandle, dwOptions);
#endif
-#if defined (_LINUX)
+#if defined (TARGET_POSIX)
*lpTargetHandle = hSourceHandle;
return 1;
#else
@@ -256,7 +256,7 @@ extern "C" int WINAPI dllDuplicateHandle(HANDLE hSourceProcessHandle, // handl
extern "C" BOOL WINAPI dllDisableThreadLibraryCalls(HMODULE h)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
return DisableThreadLibraryCalls(h);
#else
not_implement("kernel32.dll fake function DisableThreadLibraryCalls called\n"); //warning
@@ -264,7 +264,7 @@ extern "C" BOOL WINAPI dllDisableThreadLibraryCalls(HMODULE h)
#endif
}
-#ifndef _LINUX
+#ifndef TARGET_POSIX
static void DumpSystemInfo(const SYSTEM_INFO* si)
{
CLog::Log(LOGDEBUG, " Processor architecture %d\n", si->wProcessorArchitecture);
@@ -285,7 +285,7 @@ extern "C" void WINAPI dllGetSystemInfo(LPSYSTEM_INFO lpSystemInfo)
#ifdef API_DEBUG
CLog::Log(LOGDEBUG, "GetSystemInfo(0x%x) =>", lpSystemInfo);
#endif
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
// VS 2003 complains about x even so it's defined
lpSystemInfo->wProcessorArchitecture = 0; //#define PROCESSOR_ARCHITECTURE_INTEL 0
#else
@@ -406,7 +406,7 @@ extern "C" HMODULE WINAPI dllTerminateProcess(HANDLE hProcess, UINT uExitCode)
}
extern "C" HANDLE WINAPI dllGetCurrentProcess()
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
return GetCurrentProcess();
#else
#ifdef API_DEBUG
@@ -492,7 +492,7 @@ static const char ch_envs[] =
extern "C" LPVOID WINAPI dllGetEnvironmentStrings()
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
return GetEnvironmentStrings();
#else
#ifdef API_DEBUG
@@ -504,7 +504,7 @@ extern "C" LPVOID WINAPI dllGetEnvironmentStrings()
extern "C" LPVOID WINAPI dllGetEnvironmentStringsW()
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
return GetEnvironmentStringsW();
#else
return 0;
@@ -513,7 +513,7 @@ extern "C" LPVOID WINAPI dllGetEnvironmentStringsW()
extern "C" int WINAPI dllGetEnvironmentVariableA(LPCSTR lpName, LPSTR lpBuffer, DWORD nSize)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
return GetEnvironmentVariableA(lpName, lpBuffer, nSize);
#else
if (lpBuffer)
@@ -580,7 +580,7 @@ extern "C" BOOL WINAPI dllSetPriorityClass(HANDLE hProcess, DWORD dwPriorityClas
extern "C" DWORD WINAPI dllFormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPTSTR lpBuffer, DWORD nSize, va_list* Arguments)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
return FormatMessageA(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments);
#else
not_implement("kernel32.dll fake function FormatMessage called\n"); //warning
@@ -590,7 +590,7 @@ extern "C" DWORD WINAPI dllFormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD
extern "C" DWORD WINAPI dllGetFullPathNameA(LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR* lpFilePart)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
if (!lpFileName) return 0;
if(strstr(lpFileName, "://"))
{
@@ -623,7 +623,7 @@ extern "C" DWORD WINAPI dllGetFullPathNameA(LPCTSTR lpFileName, DWORD nBufferLen
extern "C" DWORD WINAPI dllGetFullPathNameW(LPCWSTR lpFileName, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR* lpFilePart)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
if (!lpFileName) return 0;
if(wcsstr(lpFileName, L"://"))
{
@@ -656,7 +656,7 @@ extern "C" DWORD WINAPI dllGetFullPathNameW(LPCWSTR lpFileName, DWORD nBufferLen
extern "C" DWORD WINAPI dllExpandEnvironmentStringsA(LPCTSTR lpSrc, LPTSTR lpDst, DWORD nSize)
{
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
return ExpandEnvironmentStringsA(lpSrc, lpDst, nSize);
#else
not_implement("kernel32.dll fake function ExpandEnvironmentStringsA called\n"); //warning
@@ -703,7 +703,7 @@ extern "C" UINT WINAPI dllGetShortPathName(LPTSTR lpszLongPath, LPTSTR lpszShort
extern "C" HANDLE WINAPI dllGetProcessHeap()
{
-#ifdef _LINUX
+#ifdef TARGET_POSIX
CLog::Log(LOGWARNING, "KERNEL32!GetProcessHeap() linux cant provide this service!");
return 0;
#else
@@ -878,7 +878,7 @@ extern "C" int WINAPI dllMultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCST
destinationBuffer = (LPWSTR)malloc(destinationBufferSize * sizeof(WCHAR));
}
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS
int ret = MultiByteToWideChar(CodePage, dwFlags, lpMultiByteStr, cbMultiByte, destinationBuffer, destinationBufferSize);
#else
int ret = 0;
@@ -922,7 +922,7 @@ extern "C" int WINAPI dllWideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWS
destinationBuffer = (LPSTR)malloc(destinationBufferSize * sizeof(char));
}
-#ifdef _WIN32
+#ifdef TARGET_WINDOWS