From bb4513bd61cfc83130ad3103ca7b1024d3ba4cf8 Mon Sep 17 00:00:00 2001 From: davilla Date: Sun, 2 Jun 2013 22:23:13 -0400 Subject: changed, use TARGET_xxx in UnrarXLib --- lib/UnrarXLib/cmddata.cpp | 2 +- lib/UnrarXLib/consio.cpp | 2 +- lib/UnrarXLib/crypt.cpp | 2 +- lib/UnrarXLib/errhnd.cpp | 6 +++--- lib/UnrarXLib/file.cpp | 14 +++++++------- lib/UnrarXLib/filefn.cpp | 16 ++++++++-------- lib/UnrarXLib/filestr.cpp | 2 +- lib/UnrarXLib/find.cpp | 2 +- lib/UnrarXLib/os.hpp | 4 ++-- lib/UnrarXLib/pathfn.cpp | 2 +- lib/UnrarXLib/rar.cpp | 4 ++-- lib/UnrarXLib/suballoc.hpp | 4 ++-- lib/UnrarXLib/unicode.cpp | 2 +- 13 files changed, 31 insertions(+), 31 deletions(-) (limited to 'lib/UnrarXLib') diff --git a/lib/UnrarXLib/cmddata.cpp b/lib/UnrarXLib/cmddata.cpp index da618d2c1e..2d338a1660 100644 --- a/lib/UnrarXLib/cmddata.cpp +++ b/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"); diff --git a/lib/UnrarXLib/consio.cpp b/lib/UnrarXLib/consio.cpp index 0ac32150d6..cf8ada1aae 100644 --- a/lib/UnrarXLib/consio.cpp +++ b/lib/UnrarXLib/consio.cpp @@ -1,4 +1,4 @@ -#if !defined(_LINUX) && !defined(_XBMC) +#if !defined(TARGET_POSIX) && !defined(_XBMC) #include "rar.hpp" #ifndef GUI diff --git a/lib/UnrarXLib/crypt.cpp b/lib/UnrarXLib/crypt.cpp index 192a82a6ab..4980e9d98d 100644 --- a/lib/UnrarXLib/crypt.cpp +++ b/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); diff --git a/lib/UnrarXLib/errhnd.cpp b/lib/UnrarXLib/errhnd.cpp index 8f245886ac..4b74312605 100644 --- a/lib/UnrarXLib/errhnd.cpp +++ b/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 diff --git a/lib/UnrarXLib/file.cpp b/lib/UnrarXLib/file.cpp index 4d9860d00f..e2d1074de6 100644 --- a/lib/UnrarXLib/file.cpp +++ b/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) diff --git a/lib/UnrarXLib/filefn.cpp b/lib/UnrarXLib/filefn.cpp index 116525986f..42998035fd 100644 --- a/lib/UnrarXLib/filefn.cpp +++ b/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); diff --git a/lib/UnrarXLib/filestr.cpp b/lib/UnrarXLib/filestr.cpp index 571a71b419..e43cbfc20f 100644 --- a/lib/UnrarXLib/filestr.cpp +++ b/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 diff --git a/lib/UnrarXLib/find.cpp b/lib/UnrarXLib/find.cpp index 8f28bd4c5c..063577ad75 100644 --- a/lib/UnrarXLib/find.cpp +++ b/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 diff --git a/lib/UnrarXLib/os.hpp b/lib/UnrarXLib/os.hpp index 165d01b64c..e7abcdc12e 100644 --- a/lib/UnrarXLib/os.hpp +++ b/lib/UnrarXLib/os.hpp @@ -1,7 +1,7 @@ #ifndef _RAR_OS_ #define _RAR_OS_ -#ifdef WIN32 +#ifdef TARGET_WINDOWS #include #endif @@ -38,7 +38,7 @@ #include "system.h" #include -#if defined(_LINUX) +#if defined(TARGET_POSIX) #include "PlatformDefs.h" #endif diff --git a/lib/UnrarXLib/pathfn.cpp b/lib/UnrarXLib/pathfn.cpp index 2da5ea70a4..5be0db065e 100644 --- a/lib/UnrarXLib/pathfn.cpp +++ b/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 diff --git a/lib/UnrarXLib/rar.cpp b/lib/UnrarXLib/rar.cpp index 1b5ad04345..7515f7e26d 100644 --- a/lib/UnrarXLib/rar.cpp +++ b/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 \*-------------------------------------------------------------------------*/ diff --git a/lib/UnrarXLib/suballoc.hpp b/lib/UnrarXLib/suballoc.hpp index d51666cebe..c10c7d4a77 100644 --- a/lib/UnrarXLib/suballoc.hpp +++ b/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 diff --git a/lib/UnrarXLib/unicode.cpp b/lib/UnrarXLib/unicode.cpp index 89e63fd452..135eac4873 100644 --- a/lib/UnrarXLib/unicode.cpp +++ b/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