Closed GoogleCodeExporter closed 9 years ago
Very interesting insight.
I'll look into it.
Original comment by yann.col...@gmail.com
on 5 Oct 2012 at 2:29
For 64-bit it should be enough to test for __LP64__.
The also had problems with endian on sparc (When using the Solaris Studio
compiler). I just moved the include files up to before the endian test.
The problem did not show under compilation though. Just that it did not work.
Original comment by thwill...@gmail.com
on 7 Oct 2012 at 3:07
I would like to open again this issue and try to include it into next release.
64-bit detection: __ia64__ will be added to the list. Thanks.
BIG_ENDIAN: the big endian macro detection has been greatly improved since this
issue was raised. hpux & sparc are now part of the detection formula.
I suspect it would work as it is today, although nothing would replace a real
test.
Packed structures: the problem with __packed__ attribute is that it is not
supported outside of GCC. #pragma pack(1) is, overall, better supported,
although not perfect, as proved by your tests. Maybe a more complex combination
of both would be necessary, although i fear it could raise code complexity.
stdint.h: Understood that older compilers may not support it.
These direct definitions were the one I originally used. I then received a few
comments stating that it was "not proper way" to declare such types, and
switched to it. So now, it seems there are conflicting advises :)
Not sure to understand the comment regarding #defines, but i guess you mean
typedef should be preferred.
Original comment by yann.col...@gmail.com
on 29 Apr 2013 at 8:01
Regarding basic types :
decided to move to the following version :
#if __STDC_VERSION__ >= 199901L // C99
# include <stdint.h>
typedef uint8_t BYTE;
typedef uint16_t U16;
typedef uint32_t U32;
typedef int32_t S32;
typedef uint64_t U64;
#else
typedef unsigned char BYTE;
typedef unsigned short U16;
typedef unsigned int U32;
typedef signed int S32;
typedef unsigned long long U64;
#endif
It seems proper : stdint.h is guaranteed by C99. For all other compilers, the
direct typedef you propose looks the best bet.
Original comment by yann.col...@gmail.com
on 29 Apr 2013 at 8:34
I'll handle it.
Original comment by yann.col...@gmail.com
on 29 Apr 2013 at 8:35
The attached file is an LZ4 release candidate,
which is expected to solve all issues mentioned in this thread,
except pragma-pack.
Original comment by yann.col...@gmail.com
on 10 May 2013 at 12:37
Attachments:
The following release candidate is supposed to solve all issues mentioned in
this thread, including the #pragma pack directive one.
Original comment by yann.col...@gmail.com
on 16 May 2013 at 9:10
Attachments:
Corrected into r95
Original comment by yann.col...@gmail.com
on 17 May 2013 at 6:45
Original issue reported on code.google.com by
wsc...@gmail.com
on 5 Oct 2012 at 2:26Attachments: