VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-17 00:06:57 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-17 00:08:18 +0200
commit2780ac962ec75f548acb616dd810515e528ac0b1 (patch)
tree3c89dab46a6f225b8e2caf04a8d51c6a29b0e6f0 /src/Common
parente47f94cb4329cfefb0a9c4efaa353a1b54268b46 (diff)
downloadVeraCrypt-2780ac962ec75f548acb616dd810515e528ac0b1.tar.gz
VeraCrypt-2780ac962ec75f548acb616dd810515e528ac0b1.zip
Linux: fix various compilation issues under Linux.
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Crypto.c2
-rw-r--r--src/Common/Crypto.h4
-rw-r--r--src/Common/Tcdefs.h4
3 files changed, 7 insertions, 3 deletions
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c
index f3045d0c..3c52ef74 100644
--- a/src/Common/Crypto.c
+++ b/src/Common/Crypto.c
@@ -760,7 +760,7 @@ int GetMaxPkcs5OutSize (void)
{
int size = 32;
- size = max (size, EAGetLargestKeyForMode (XTS) * 2); // Sizes of primary + secondary keys
+ size = VC_MAX (size, EAGetLargestKeyForMode (XTS) * 2); // Sizes of primary + secondary keys
return size;
}
diff --git a/src/Common/Crypto.h b/src/Common/Crypto.h
index 7d99f233..6a943edf 100644
--- a/src/Common/Crypto.h
+++ b/src/Common/Crypto.h
@@ -171,9 +171,9 @@ typedef struct
#else
#ifdef TC_WINDOWS_BOOT
-#define MAX_EXPANDED_KEY max((AES_KS + SERPENT_KS + TWOFISH_KS), CAMELLIA_KS)
+#define MAX_EXPANDED_KEY VC_MAX((AES_KS + SERPENT_KS + TWOFISH_KS), CAMELLIA_KS)
#else
-#define MAX_EXPANDED_KEY max(max(max((AES_KS + SERPENT_KS + TWOFISH_KS), GOST_KS), CAMELLIA_KS), KUZNYECHIK_KS)
+#define MAX_EXPANDED_KEY VC_MAX(VC_MAX(VC_MAX((AES_KS + SERPENT_KS + TWOFISH_KS), GOST_KS), CAMELLIA_KS), KUZNYECHIK_KS)
#endif
#endif
diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h
index a3bee8c3..d9861c35 100644
--- a/src/Common/Tcdefs.h
+++ b/src/Common/Tcdefs.h
@@ -75,6 +75,9 @@ extern unsigned short _rotl16(unsigned short value, unsigned char shift);
#define WIDE(x) (LPWSTR)L##x
+#define VC_MAX(a,b) ((a)>(b))?(a):(b)
+#define VC_MIN(a,b) ((a)<(b))?(a):(b)
+
#ifdef _MSC_VER
typedef __int8 int8;
@@ -100,6 +103,7 @@ typedef unsigned __int64 uint64;
#include <inttypes.h>
#include <limits.h>
+#include <memory.h>
typedef int8_t int8;
typedef int16_t int16;