BACKGROUND: In the API I am porting, there are a large number of functions prefixed with sqlite3_. They are encapsulated in a class named Sqlite3, so the function call is Sqlite3.sqlite3_...
I've created a number of alias calls, similar to the following,
//C# alias for call
public static void result_error_toobig(sqlite3_context pCtx)
{ sqlite3_result_error_toobig(pCtx); }
//Native call
public static void sqlite3_result_error_toobig(sqlite3_context pCtx)
{
Debug.Assert(sqlite3_mutex_held(pCtx.s.db.mutex));
pCtx.isError = SQLITE_ERROR;
setResultStrOrError(pCtx, "string or blob too big", -1,
SQLITE_UTF8, SQLITE_STATIC);
}
This allows me to write code, like Sqlite3.result_error_toobig(pCtx);
QUESTION:
- Will the compiler optimize the call, so the overhead is minimal?
- Is there an easier way to create this type of alias?