Mercurial > crc32
annotate README @ 1:90cb48b87dcc
*: don't hardcode the list of impls in multiple places
| author | Paper <paper@tflc.us> |
|---|---|
| date | Mon, 09 Feb 2026 01:18:06 -0500 |
| parents | 422835bc1aca |
| children | ead9f84d11db |
| rev | line source |
|---|---|
| 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 | |
| 10 At the moment it is hardcoded for x86-64 and gcc, but it could be adapted to | |
|
1
90cb48b87dcc
*: don't hardcode the list of impls in multiple places
Paper <paper@tflc.us>
parents:
0
diff
changeset
|
11 other compilers if they also have features like e.g. alignas() or whatever. |
|
90cb48b87dcc
*: don't hardcode the list of impls in multiple places
Paper <paper@tflc.us>
parents:
0
diff
changeset
|
12 You'd also need to disable the x86 code which isn't difficult but is a bit |
|
90cb48b87dcc
*: don't hardcode the list of impls in multiple places
Paper <paper@tflc.us>
parents:
0
diff
changeset
|
13 annoying. |
