nisse@lysator.liu.se (Niels Möller) writes:
Let me give it a try using the C preprocessor first.
Done now, starting from your macros.
Argument lists have to be passed both with and without types, which looks a bit ugly, but I think it's good enough. E.g, this is the code specific to _aes_encrypt:
DECLARE_FAT_FUNC(_nettle_aes_encrypt, aes_crypt_internal_func) DECLARE_FAT_FUNC_VAR(aes_encrypt, aes_crypt_internal_func, x86_64) DECLARE_FAT_FUNC_VAR(aes_encrypt, aes_crypt_internal_func, aesni)
DEFINE_FAT_FUNC(_nettle_aes_encrypt, void, (unsigned rounds, const uint32_t *keys, const struct aes_table *T, size_t length, uint8_t *dst, const uint8_t *src), (rounds, keys, T, length, dst, src))
The nice thing is that these definitions are not arch-specific, so the macros could be moved to fat.h and reused when writing fat-arm.c.
Regards, /Niels