mingw build stuff
This commit is contained in:
parent
ba981b075a
commit
6455c3966c
|
@ -449,6 +449,7 @@
|
||||||
# define SUPPORTS_NETWORKING (HAVE_SOCKET && !IS_SORTIX && !IS_DOS_DJGPP && !IS_REDOX)
|
# define SUPPORTS_NETWORKING (HAVE_SOCKET && !IS_SORTIX && !IS_DOS_DJGPP && !IS_REDOX)
|
||||||
# define SUPPORTS_SYSLOG (HAVE_SYSLOG && !IS_SKYOS && !IS_RISCOS)
|
# define SUPPORTS_SYSLOG (HAVE_SYSLOG && !IS_SKYOS && !IS_RISCOS)
|
||||||
# define NEEDS_SWAB_IMPL (IS_CYGWIN || IS_SYLLABLE || IS_ANDROID || IS_SORTIX)
|
# define NEEDS_SWAB_IMPL (IS_CYGWIN || IS_SYLLABLE || IS_ANDROID || IS_SORTIX)
|
||||||
|
# define SWAB_TAKES_CHAR_PTRS (IS_MINGW)
|
||||||
# define USES_MBLEN (!IS_ANDROID && !IS_AROS)
|
# define USES_MBLEN (!IS_ANDROID && !IS_AROS)
|
||||||
# define USES_DOS_DEVICE_PATH (IS_DOS_DJGPP || (IS_WIN32 && !IS_CYGWIN) || (IS_OS2 && !IS_EMX))
|
# define USES_DOS_DEVICE_PATH (IS_DOS_DJGPP || (IS_WIN32 && !IS_CYGWIN) || (IS_OS2 && !IS_EMX))
|
||||||
# define USES_DEVICE_PATH (IS_AROS || IS_RISCOS || IS_REDOX || USES_DOS_DEVICE_PATH)
|
# define USES_DEVICE_PATH (IS_AROS || IS_RISCOS || IS_REDOX || USES_DOS_DEVICE_PATH)
|
||||||
|
@ -503,13 +504,6 @@
|
||||||
# define UNAME_SUCCESS_ZERO 1
|
# define UNAME_SUCCESS_ZERO 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Work around single-arg mkdir on MinGW.
|
|
||||||
// consider using autoconf AX_FUNC_MKDIR if
|
|
||||||
// we need to handle any more cases here
|
|
||||||
/*#if IS_MINGW
|
|
||||||
# define mkdir(a,b) mkdir(a)
|
|
||||||
#endif*/
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
//
|
//
|
||||||
|
|
|
@ -83,7 +83,7 @@ void util_SignalHandler(int sig)
|
||||||
|
|
||||||
void tw_psignal(int sig, const TCHAR* str)
|
void tw_psignal(int sig, const TCHAR* str)
|
||||||
{
|
{
|
||||||
const TCHAR* siglist[NSIG] = {_T("Unknown Signal"),
|
const TCHAR* siglist[] = { _T("Unknown Signal"),
|
||||||
_T("Hangup"),
|
_T("Hangup"),
|
||||||
_T("Interrupt"),
|
_T("Interrupt"),
|
||||||
_T("Quit"),
|
_T("Quit"),
|
||||||
|
|
|
@ -114,8 +114,8 @@ void cArchiveSigGen::CalculateSignatures(cArchive& a)
|
||||||
|
|
||||||
if (s_direct)
|
if (s_direct)
|
||||||
{
|
{
|
||||||
unsigned long mod = (unsigned long)abBuf % iSignature::SUGGESTED_BLOCK_SIZE;
|
uintptr_t mod = (uintptr_t)abBuf % iSignature::SUGGESTED_BLOCK_SIZE;
|
||||||
unsigned long offset = (iSignature::SUGGESTED_BLOCK_SIZE - mod);
|
uintptr_t offset = (iSignature::SUGGESTED_BLOCK_SIZE - mod);
|
||||||
pBuf = abBuf + offset;
|
pBuf = abBuf + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2076,8 +2076,15 @@ static bool ChangePassphrase(const TCHAR* keyPath, wc16_string passphraseOld, wc
|
||||||
memcpy(passphraseCopyOld, passphraseOld.data(), passphraseLenOld);
|
memcpy(passphraseCopyOld, passphraseOld.data(), passphraseLenOld);
|
||||||
memcpy(passphraseCopy, passphrase.data(), passphraseLen);
|
memcpy(passphraseCopy, passphrase.data(), passphraseLen);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if SWAB_TAKES_CHAR_PTRS
|
||||||
|
swab((char*)passphraseOld.data(), (char*)passphraseCopyOld, passphraseLenOld);
|
||||||
|
swab((char*)passphrase.data(), (char*)passphraseCopy, passphraseLen);
|
||||||
|
#else
|
||||||
swab(passphraseOld.data(), passphraseCopyOld, passphraseLenOld);
|
swab(passphraseOld.data(), passphraseCopyOld, passphraseLenOld);
|
||||||
swab(passphrase.data(), passphraseCopy, passphraseLen);
|
swab(passphrase.data(), passphraseCopy, passphraseLen);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool result;
|
bool result;
|
||||||
|
|
|
@ -385,7 +385,7 @@ std::string TwTestDir()
|
||||||
iFSServices::GetInstance()->GetCurrentDir(dir);
|
iFSServices::GetInstance()->GetCurrentDir(dir);
|
||||||
dir.append("/TWTestData");
|
dir.append("/TWTestData");
|
||||||
TCERR << "Using test directory: " << dir << std::endl;
|
TCERR << "Using test directory: " << dir << std::endl;
|
||||||
mkdir(dir.c_str(), 0777);
|
tw_mkdir(dir.c_str(), 0777);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dir;
|
return dir;
|
||||||
|
|
|
@ -92,5 +92,16 @@ void RegisterTest(const std::string& suite, const std::string testName, TestPtr
|
||||||
void skip(const std::string& reason);
|
void skip(const std::string& reason);
|
||||||
void fail(const std::string& reason);
|
void fail(const std::string& reason);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Misc platform utility stuff available for all tests
|
||||||
|
|
||||||
|
// Could use AX_FUNC_MKDIR autoconf macro if we need to handle
|
||||||
|
// any additional cases besides these
|
||||||
|
#if IS_MINGW
|
||||||
|
# define tw_mkdir(a,b) mkdir(a)
|
||||||
|
#else
|
||||||
|
# define tw_mkdir(a,b) mkdir(a,b)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // __TEST_H
|
#endif // __TEST_H
|
||||||
|
|
|
@ -151,9 +151,9 @@ void TestTextReportViewer()
|
||||||
fcoNameSpec1 = fcoNameTempDir += _T("SPEC1/");
|
fcoNameSpec1 = fcoNameTempDir += _T("SPEC1/");
|
||||||
fcoNameSpec2 = fcoNameTempDir += _T("SPEC2/");
|
fcoNameSpec2 = fcoNameTempDir += _T("SPEC2/");
|
||||||
|
|
||||||
mkdir( fcoNameTempDir.c_str(), 0777 );
|
tw_mkdir( fcoNameTempDir.c_str(), 0777 );
|
||||||
mkdir( fcoNameSpec1.AsString().c_str(), 0777 );
|
tw_mkdir( fcoNameSpec1.AsString().c_str(), 0777 );
|
||||||
mkdir( fcoNameSpec2.AsString().c_str(), 0777 );
|
tw_mkdir( fcoNameSpec2.AsString().c_str(), 0777 );
|
||||||
|
|
||||||
fcoNameTempFile = fcoNameTempDir += _T("twtempXXXXXX");
|
fcoNameTempFile = fcoNameTempDir += _T("twtempXXXXXX");
|
||||||
pFSServices->MakeTempFilename( fcoNameTempFile );
|
pFSServices->MakeTempFilename( fcoNameTempFile );
|
||||||
|
@ -473,7 +473,7 @@ void MakeFile(TSTRING& strNameMakeMe)
|
||||||
|
|
||||||
void MakeDir(const TCHAR* const lpszDirName)
|
void MakeDir(const TCHAR* const lpszDirName)
|
||||||
{
|
{
|
||||||
TEST(0 == mkdir(lpszDirName, 0777))
|
TEST(0 == tw_mkdir(lpszDirName, 0777))
|
||||||
}
|
}
|
||||||
|
|
||||||
//#endif //FIXED_TRV_TEST_SUITE
|
//#endif //FIXED_TRV_TEST_SUITE
|
||||||
|
|
|
@ -62,7 +62,7 @@ void TestTWUtil()
|
||||||
TSTRING tmpFN = TwTestPath("fileexiststest.tmp");
|
TSTRING tmpFN = TwTestPath("fileexiststest.tmp");
|
||||||
|
|
||||||
// make a subdir in the TEMP_DIR
|
// make a subdir in the TEMP_DIR
|
||||||
mkdir(tmpDir.c_str(), 0700);
|
tw_mkdir(tmpDir.c_str(), 0700);
|
||||||
chmod(tmpDir.c_str(), 0700);
|
chmod(tmpDir.c_str(), 0700);
|
||||||
|
|
||||||
// make sure file is not there
|
// make sure file is not there
|
||||||
|
|
Loading…
Reference in New Issue