Hi
long long are working as 64 bits in MS visualstuido 7.1
I do not have older version of vc, but I think it work same there
----- Original Message -----
From: "Gunnar Dalsnes" <hardon(a)online.no>
To: "ReactOS Development List" <ros-dev(a)reactos.com>
Sent: Tuesday, February 01, 2005 1:18 PM
Subject: [ros-dev] gcc/msvc int64 suffix/LARGE_INTEGER portability macros
Suggested gcc/msvc portability macros:
#if defined(_MSC_VER)
#define MK_INT64(a) (a)
#define MK_UINT64(a) (a)
__inline LARGE_INTEGER MK_LARGE_INTEGER(__int64 i)
{
LARGE_INTEGER li;
li.QuadPart = i;
return li;
}
#define LARGE_INTEGER_NULL MK_LARGE_INTEGER(0)
#elif defined (__GNUC__)
#define MK_INT64(a) (a##LL)
#define MK_UINT64(a) (a##ULL)
#define MK_LARGE_INTEGER(a) ((LARGE_INTEGER)(LONGLONG)a)
#define LARGE_INTEGER_NULL ((LARGE_INTEGER)(LONGLONG)0LL)
#else
#error Unknown compiler for LARGE_INTEGER/int64 macros
#endif
example:
LARGE_INTEGER test1(LARGE_INTEGER arg)
{
return MK_LARGE_INTEGER(arg.QuadPart+3);
}
LARGE_INTEGER test2()
{
LARGE_INTEGER a = LARGE_INTEGER_NULL;
a.QuadPart += test1(LARGE_INTEGER_NULL).QuadPart;
a.QuadPart += MK_INT64(1152921504606846975);
return LARGE_INTEGER_NULL;
}
What do you think?
Gunnar
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.com
http://reactos.com:8080/mailman/listinfo/ros-dev