|
0
|
1 This code was mostly written as an experiment, to see just how much
|
|
|
2 could be done using only the C preprocessor (give or take). Turns out
|
|
|
3 you can do quite a lot.
|
|
|
4
|
|
|
5 In fact, *all* of the tables in this library are generated at compile-time.
|
|
|
6 The polynomial is #define'd in crc32i.h, and all of the tables are generated
|
|
|
7 through a combination of enums and preprocessor trickery. Note that this
|
|
|
8 may cause this code to compile slowly on some machines or compilers.
|
|
|
9
|
|
2
|
10 At the moment it is hardcoded for gcc, but it could be adapted to other
|
|
|
11 compilers if they also have features like e.g. alignas() or whatever.
|
|
|
12 The code relies on C99 stdint.h but if that's not available you can just
|
|
|
13 typedef to the suitable C89 types on your system.
|
|
|
14
|
|
|
15 --paper <paper@tflc.us>
|