mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
be more precise in long long int literal specification for ANSI compilers (gcc3 requires an LL suffix on literals that do not fit in an int
This commit is contained in:
@@ -21,6 +21,13 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h> /* for memcmp() */
|
||||
|
||||
/* adjust for compilers that can't understand using LLU suffix for uint64_t literals */
|
||||
#ifdef _MSC_VER
|
||||
#define FLAC__U64L(x) x
|
||||
#else
|
||||
#define FLAC__U64L(x) x##LLU
|
||||
#endif
|
||||
|
||||
/*
|
||||
* WATCHOUT! Since FLAC__BitBuffer is a private structure, we use a copy of
|
||||
* the definition here to get at the internals. Make sure this is kept up
|
||||
@@ -174,7 +181,7 @@ FLAC__bool test_bitbuffer()
|
||||
FLAC__bitbuffer_write_zeroes(bb, 4) &&
|
||||
FLAC__bitbuffer_write_raw_uint32(bb, 0x3, 2) &&
|
||||
FLAC__bitbuffer_write_zeroes(bb, 8) &&
|
||||
FLAC__bitbuffer_write_raw_uint64(bb, 0xaaaaaaaadeadbeef, 64) &&
|
||||
FLAC__bitbuffer_write_raw_uint64(bb, FLAC__U64L(0xaaaaaaaadeadbeef), 64) &&
|
||||
FLAC__bitbuffer_write_raw_uint32(bb, 0xace, 12)
|
||||
;
|
||||
if(!ok) {
|
||||
@@ -674,7 +681,7 @@ FLAC__bool test_bitbuffer()
|
||||
|
||||
printf("testing utf8_uint64(0x0000000FFFFFFFFF)... ");
|
||||
FLAC__bitbuffer_clear(bb);
|
||||
FLAC__bitbuffer_write_utf8_uint64(bb, 0x0000000FFFFFFFFF);
|
||||
FLAC__bitbuffer_write_utf8_uint64(bb, FLAC__U64L(0x0000000FFFFFFFFF));
|
||||
ok = bb->total_bits == 56 && bb->buffer[0] == 0xFE && bb->buffer[1] == 0xBF && bb->buffer[2] == 0xBF && bb->buffer[3] == 0xBF && bb->buffer[4] == 0xBF && bb->buffer[5] == 0xBF && bb->buffer[6] == 0xBF;
|
||||
printf("%s\n", ok?"OK":"FAILED");
|
||||
if(!ok) {
|
||||
|
||||
Reference in New Issue
Block a user