thoughtpolice/salt — Issue #11: Eliminate glue
Author: thoughtpolice
Created: 2011-10-15 15:27:30+00:00
State: open

It'd be nice if the glue code in `cbits` could go away. Most of the typical definitions for NaCl functions unfortunately are hidden behind the C preprocessor though, and GHC does *not* parse `.h` files, so it depends on you specifying the function's symbol name in the library you're linking to. But we don't know that, because the functions name incorporates build-time settings, i.e. `crypto_box_curve25519xsalsa20poly1305` may actually be `crypto_box_curve25519xsalsa20poly1305_ref` or some other arbitrary string based on CPU identifiers.

It would be awesome if there was a way to extract the `#define` from the header and use that in the foreign declaration.