Can you explain why you would want it to not compile as a
loadable module? (i.e. under what circumstances you would not define
COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE).

On 9/28/07, Joe Wilson <[EMAIL PROTECTED]> wrote:
> --- Liam Healy <[EMAIL PROTECTED]> wrote:
> > Thanks.  I have included your changes in extension-functions.c so now
> > sqlite3_load_extension is usable.  I had been using
> > sqlite3RegisterExtraFunctions which is not the official interface, and
> > that is why I never encountered this problem.  Also, I have improved
> > the Mac OSX instructions for those that use Macs.
> >
> > The new version has been uploaded to sqlite.org/contrib.
>
> The following patch allows extension-functions.c to be compiled as
> either as a standalone shared library extension module, or statically
> (against the sqlite3.h/sqlite3.c amalgamation) depending on whether
> COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE is #defined.
>
> I tested it against
>
>  http://www.sqlite.org/contrib/download/extension-functions.c?get=22
>
> from 2007-09-28 16:25:46 and it seems to work.
>
>
> --- extension-functions.c-orig  2007-09-28 12:52:13.000000000 -0400
> +++ extension-functions.c       2007-09-28 12:52:13.000000000 -0400
> @@ -87,8 +87,12 @@
>
>  //#if SQLITE_WITH_EXTRA_FUNCTIONS
>
> +#ifdef COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE
>  #include "sqlite3ext.h"
>  SQLITE_EXTENSION_INIT1
> +#else
> +#include "sqlite3.h"
> +#endif
>
>  #include <ctype.h>
>  /* relicoder */
> @@ -1618,8 +1622,7 @@
>  ** functions.  This should be the only routine in this file with
>  ** external linkage.
>  */
> -int sqlite3_extension_init(sqlite3 *db, char **pzErrMsg, const 
> sqlite3_api_routines *pApi){
> -  SQLITE_EXTENSION_INIT2(pApi);
> +int RegisterExtensionFunctions(sqlite3 *db){
>    static const struct FuncDef {
>       char *zName;
>       signed char nArg;
> @@ -1748,6 +1751,15 @@
>    return 0;
>  }
>
> +#ifdef COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE
> +int sqlite3_extension_init(
> +    sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi){
> +  SQLITE_EXTENSION_INIT2(pApi);
> +  RegisterExtensionFunctions(db);
> +  return 0;
> +}
> +#endif /* COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE */
> +
>  //#endif
>
>  map map_make(cmp_func cmp){
>

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to