AndrasKovacs / flatparse

Fast parsing from bytestrings
MIT License
146 stars 12 forks source link

Support 32-bit platforms #53

Open raehik opened 7 months ago

raehik commented 7 months ago

We assume native word size to be 64-bit in a few places:

I've just learned you can #include "MachDeps.h" and then access WORD_SIZE_IN_BITS. We could check this at the various locations where we assume native word size, and provide 32-bit versions as well as existing 64-bit ones.

This would introduce some amount of ugliness for a usecase that I don't think is popular (heck I don't even know how to build a 32-bit GHC). If it still seems reasonable, I'd gladly start on it.

AndrasKovacs commented 7 months ago

I agree It's a good idea to replace literals with MachDeps constants.

raehik commented 7 months ago

Relevant to this, I learned that WORDS_BIGENDIAN is defined in MachDeps.h too, but we never #include it. Fix over at #55 .