On 30/07/2012 09:24, Justin Cormack wrote:
As another example, one of my projects requires the log1p function. It is present in libc on some platforms but not on others. If it is missing then I use a Lua implementation of it but it is not as fast as the native version. I could use a stand-alone C implementation but then I have the worst of both worlds (slower than the Lua version and has an additional library dependency.)If it is something for which there is no way to do an alternative implementation I might just let it error. What is code using your library going to do if it needs the functions? Maybe you provide a test routine or table that lets the user know what is there so they can abort if stuff they need is missing.
Finn