mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-28 14:03:29 +01:00
Linux: Fix compilation error if type __u64 is already defined by gcc
This is the case with Mageia Cauldron which has gcc 9.2.1
This commit is contained in:
parent
659df4c6df
commit
3fa636d477
@ -49,8 +49,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
typedef uint64 __u64;
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
typedef uint64 uint64_t;
|
typedef uint64 uint64_t;
|
||||||
@ -70,7 +68,7 @@ typedef int32 ssize_t;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static VC_INLINE void jent_get_nstime(__u64 *out)
|
static VC_INLINE void jent_get_nstime(uint64 *out)
|
||||||
{
|
{
|
||||||
*out = __rdtsc();;
|
*out = __rdtsc();;
|
||||||
}
|
}
|
||||||
@ -80,7 +78,7 @@ static VC_INLINE void jent_get_nstime(__u64 *out)
|
|||||||
/* taken from Linux kernel */
|
/* taken from Linux kernel */
|
||||||
#if CRYPTOPP_BOOL_X64
|
#if CRYPTOPP_BOOL_X64
|
||||||
#define DECLARE_ARGS(val, low, high) unsigned low, high
|
#define DECLARE_ARGS(val, low, high) unsigned low, high
|
||||||
#define EAX_EDX_VAL(val, low, high) ((low) | ((__u64)(high) << 32))
|
#define EAX_EDX_VAL(val, low, high) ((low) | ((uint64)(high) << 32))
|
||||||
#define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high)
|
#define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high)
|
||||||
#else
|
#else
|
||||||
#define DECLARE_ARGS(val, low, high) unsigned long long val
|
#define DECLARE_ARGS(val, low, high) unsigned long long val
|
||||||
@ -88,7 +86,7 @@ static VC_INLINE void jent_get_nstime(__u64 *out)
|
|||||||
#define EAX_EDX_RET(val, low, high) "=A" (val)
|
#define EAX_EDX_RET(val, low, high) "=A" (val)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VC_INLINE void jent_get_nstime(__u64 *out)
|
VC_INLINE void jent_get_nstime(uint64 *out)
|
||||||
{
|
{
|
||||||
DECLARE_ARGS(val, low, high);
|
DECLARE_ARGS(val, low, high);
|
||||||
asm volatile("rdtsc" : EAX_EDX_RET(val, low, high));
|
asm volatile("rdtsc" : EAX_EDX_RET(val, low, high));
|
||||||
|
Loading…
Reference in New Issue
Block a user