Errors and debugging

Errors and debugging
Extended error reporting and debugging features

By default, functions like open_dll and define_c_func will crash your application if they fail. They will also output some meaningful error message of what went wrong (e.g. "function not found"). You can override this behavior by defining one of several ifdef constants using with define or -D on the command line.

DLL_DEBUG
Enables debugging output. Functions like open_dll and define_c_func will output their results to the console (STDERR).

DLL_WARNING
Prevents errors from crashing your application, and instead only outputs warnings to the console (STDERR).

DLL_SILENT
Turns off all warning and debugging output. This is useful for final production-quality code.

WARNING Only enable this feature when you are sure everything will work or your application could crash unexpectedly.

DLL_CDECL
Force all routines declared with define_c_func or define_c_proc to use CDECL calling convention. This should only be for debuggin purposes since you could inadvertently corrupt another library that expects routines to be declared with STDCALL (i.e. all Windows routines).