ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libecb/Changes
(Generate patch)

Comparing libecb/Changes (file contents):
Revision 1.5 by root, Mon May 28 08:28:26 2012 UTC vs.
Revision 1.14 by root, Wed Oct 15 13:46:25 2014 UTC

1implement is_constant for c11: https://gustedt.wordpress.com/2013/08/22/testing-compile-time-constness-and-null-pointers-with-c11s-_generic/
2
3#ifdef _MSC_VER
4
5#include <stdlib.h>
6#define bswap_32(x) _byteswap_ulong(x)
7#define bswap_64(x) _byteswap_uint64(x)
8
9#elif defined(__APPLE__)
10
11// Mac OS X / Darwin features
12#include <libkern/OSByteOrder.h>
13#define bswap_32(x) OSSwapInt32(x)
14#define bswap_64(x) OSSwapInt64(x)
15
16#elif defined(__sun) || defined(sun)
17
18#include <sys/byteorder.h>
19#define bswap_32(x) BSWAP_32(x)
20#define bswap_64(x) BSWAP_64(x)
21
22#elif defined(__FreeBSD__)
23
24#include <sys/endian.h>
25#define bswap_32(x) bswap32(x)
26#define bswap_64(x) bswap64(x)
27
28#elif defined(__OpenBSD__)
29
30#include <sys/types.h>
31#define bswap_32(x) swap32(x)
32#define bswap_64(x) swap64(x)
33
34#elif defined(__NetBSD__)
35
36#include <sys/types.h>
37#include <machine/bswap.h>
38#if defined(__BSWAP_RENAME) && !defined(__bswap_32)
39#define bswap_32(x) bswap32(x)
40#define bswap_64(x) bswap64(x)
41#endif
42
43#else
44
45#include <byteswap.h>
46
47#endif
48
490x00010001
50 - add ecb_is_pot32/64.
51 - add intptr_t/uintptr_t.
52 - add ECB_PTRSIZE.
53 - more macros for C/C++ version checks.
54 - support C11 atomics for memory fences.
55 - support gcc-4.7 atomics for memory fences.
56 - support m68k, m88k and sh (patch by Miod Vallat).
57 - add ecb_binary16_to_float.
58
59TODO: ecb_restrict_array etc. http://ue.tst.eu/5093eafd713ec5fda776d8065070aa4c.txt
1TODO: ffs/clz 60TODO: ffs/clz
264 bit variants of everything 6164 bit variants of everything
3TODO: examples from X for clz/ctz 62TODO: examples from X for clz/ctz
4TODO: arithmetic right shift 63TODO: arithmetic right shift
5TODO: bit reversal
6TODO: template/generic functions for x32/x64 and so on 64TODO: template/generic functions for x32/x64 and so on
7TODO: #define ecb_integer_multiples_of(n,d) ((char (*)[d])(n) - (char (*)[d])0) 65TODO: #define ecb_integer_multiples_of(n,d) ((char (*)[d])(n) - (char (*)[d])0)
8TODO: is_pot
9TODO: uintptr_t
10TODO: generalised shift 66TODO: generalised shift
67TODO: #define ECB_FAST_UNALIGNED_ACCESS
11unsigned long gensh(unsigned long v, int x) { 68unsigned long gensh(unsigned long v, int x) {
12int a, b; 69int a, b;
13 a = (v << x) & -(((unsigned int)x) < 32); 70 a = (v << x) & -(((unsigned int)x) < 32);
14 x = -x; 71 x = -x;
15 b = (v >> x) & -(((unsigned int)x) < 32); 72 b = (v >> x) & -(((unsigned int)x) < 32);
16 return a|b; 73 return a|b;
17} 74}
75
76TODO: read/write unaligned macros
77TODO: htonl and friends
78TODO: macro to convetr from unsigned to signed "the natural way"
79TODO: ecb_deprecated with message
80TODO: ecb_static_assert, with message (just like boost), or somesuch, using array-declaration
81TODO: alignof
82
83

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines