Re: function to check if a symbol in a library exists or not

  • From: Finn Wilcox <finnw@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 30 Jul 2012 16:46:06 +0100

On 30/07/2012 09:24, Justin Cormack wrote:

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.

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.)

Finn

Other related posts: