From 2fd3ca94d47b92a828427f82357a2ada6984c7a5 Mon Sep 17 00:00:00 2001 From: Patrick McIlroy Date: Fri, 14 Mar 2008 19:18:04 +0000 Subject: [PATCH] git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg@127 83fadc84-e282-4d84-a09a-c4228d6ae7e5 --- src/ITG2CryptInterface.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ITG2CryptInterface.cpp b/src/ITG2CryptInterface.cpp index c468e3b8..04fde34b 100644 --- a/src/ITG2CryptInterface.cpp +++ b/src/ITG2CryptInterface.cpp @@ -11,8 +11,9 @@ #if defined(UNIX) #include #elif defined(WIN32) +#include #include -#define O_RDONLY 0x0000 // attempting _O_RDONLY returns "undeclared identifier" +//#define O_RDONLY 0x0000 // attempting _O_RDONLY returns "undeclared identifier" #define open(a,b) _open(a,b) #define read(a,b,c) _read(a,b,c) #define lseek(a,b,c) _lseek(a,b,c) @@ -25,7 +26,12 @@ crypt_file *ITG2CryptInterface::crypt_open(CString name, CString secret) unsigned char *subkey, verifyblock[16]; size_t got, subkeysize; unsigned char *SHABuffer, *AESKey, plaintext[16], AESSHABuffer[64]; +#ifdef WIN32 + newfile->fd = open(name.c_str(), O_RDONLY | O_BINARY); +#else newfile->fd = open(name.c_str(), O_RDONLY); +#endif + if (newfile->fd == -1) { LOG->Warn("ITG2CryptInterface: Could not open %s: %s", name.c_str(), strerror(errno)); -- 2.11.0