Fix compilation using Visual Studio .NET 2002
Microsoft introduced the `LL` suffix for integer literals in Visual Studio .NET 2003 - earlier versions use `i64`master
parent
19dee481ea
commit
709d89b438
|
@ -499,18 +499,25 @@ value caml_int64_direct_bswap(value v)
|
|||
{ return caml_swap64(v); }
|
||||
#endif
|
||||
|
||||
/* Microsoft introduced the LL integer literal suffix in Visual C++ .NET 2003 */
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1400
|
||||
#define INT64_LITERAL(s) s ## i64
|
||||
#else
|
||||
#define INT64_LITERAL(s) s ## LL
|
||||
#endif
|
||||
|
||||
CAMLprim value caml_int64_bswap(value v)
|
||||
{
|
||||
int64_t x = Int64_val(v);
|
||||
return caml_copy_int64
|
||||
(((x & 0x00000000000000FFULL) << 56) |
|
||||
((x & 0x000000000000FF00ULL) << 40) |
|
||||
((x & 0x0000000000FF0000ULL) << 24) |
|
||||
((x & 0x00000000FF000000ULL) << 8) |
|
||||
((x & 0x000000FF00000000ULL) >> 8) |
|
||||
((x & 0x0000FF0000000000ULL) >> 24) |
|
||||
((x & 0x00FF000000000000ULL) >> 40) |
|
||||
((x & 0xFF00000000000000ULL) >> 56));
|
||||
(((x & INT64_LITERAL(0x00000000000000FFU)) << 56) |
|
||||
((x & INT64_LITERAL(0x000000000000FF00U)) << 40) |
|
||||
((x & INT64_LITERAL(0x0000000000FF0000U)) << 24) |
|
||||
((x & INT64_LITERAL(0x00000000FF000000U)) << 8) |
|
||||
((x & INT64_LITERAL(0x000000FF00000000U)) >> 8) |
|
||||
((x & INT64_LITERAL(0x0000FF0000000000U)) >> 24) |
|
||||
((x & INT64_LITERAL(0x00FF000000000000U)) >> 40) |
|
||||
((x & INT64_LITERAL(0xFF00000000000000U)) >> 56));
|
||||
}
|
||||
|
||||
CAMLprim value caml_int64_of_int(value v)
|
||||
|
|
Loading…
Reference in New Issue