From 9ee3d01f6ed5748ef88a4b5992cd6be48afaf3b8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 6 Oct 2013 04:21:03 -0700 Subject: Use a simpler U64 macro to make 64-bit constants --- OpenAL32/Include/alMain.h | 12 +++++++++++- OpenAL32/alSource.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 94d69bf3..004c4016 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -46,7 +46,17 @@ typedef unsigned long long ALuint64; typedef ptrdiff_t ALintptrEXT; typedef ptrdiff_t ALsizeiptrEXT; -#define MAKEU64(x,y) (((ALuint64)(x)<<32)|(ALuint64)(y)) +#ifndef U64 +#if !defined(_MSC_VER) +#if SIZEOF_LONG_LONG == 8 +#define U64(x) ((ALuint64)(x##ull)) +#elif SIZEOF_LONG == 8 +#define U64(x) ((ALuint64)(x##ul)) +#endif +#else +#define U64(x) ((ALuint64)(x##ui64)) +#endif +#endif #ifdef HAVE_GCC_FORMAT #define PRINTF_STYLE(x, y) __attribute__((format(printf, (x), (y)))) diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 1dd9716c..0e84ba8c 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2430,7 +2430,7 @@ static ALint64 GetSourceOffset(const ALsource *Source) BufferList = BufferList->next; } - return (ALint64)minu64(readPos, MAKEU64(0x7fffffff,0xffffffff)); + return (ALint64)minu64(readPos, U64(0x7fffffffffffffff)); } /* GetSourceSecOffset -- cgit v1.2.3