/ Check-in [7b9682c6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix build whether compiling with or without auto-extension enabled (CVS 4891)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7b9682c65f545b09d410173cf282f7c4f4438097
User & Date: mlcreech 2008-03-19 23:52:35
Context
2008-03-20
00:32
Fix the load-extension mechanism so that tests build with or without it. This check-in also includes prototypes for the new sqlite3_limit() interface, but no implementation. (CVS 4892) check-in: bee38c2d user: drh tags: trunk
2008-03-19
23:52
Fix build whether compiling with or without auto-extension enabled (CVS 4891) check-in: 7b9682c6 user: mlcreech tags: trunk
23:15
Don't wrongly look for the amalgamation in $(TOP) (CVS 4890) check-in: 41d6ca31 user: mlcreech tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/loadext.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to dynamically load extensions into
    13     13   ** the SQLite library.
    14     14   */
    15         -#ifndef SQLITE_OMIT_LOAD_EXTENSION
    16     15   
    17     16   #ifndef SQLITE_CORE
    18     17     #define SQLITE_CORE 1  /* Disable the API redefinition in sqlite3ext.h */
    19     18   #endif
    20     19   #include "sqlite3ext.h"
    21     20   #include "sqliteInt.h"
    22     21   #include <string.h>
    23     22   #include <ctype.h>
           23  +
           24  +#ifndef SQLITE_OMIT_LOAD_EXTENSION
    24     25   
    25     26   /*
    26     27   ** Some API routines are omitted when various features are
    27     28   ** excluded from a build of SQLite.  Substitute a NULL pointer
    28     29   ** for any missing APIs.
    29     30   */
    30     31   #ifndef SQLITE_ENABLE_COLUMN_METADATA
................................................................................
   496    497     sqlite3_mutex_enter(mutex);
   497    498     sqlite3_free(autoext.aExt);
   498    499     autoext.aExt = 0;
   499    500     autoext.nExt = 0;
   500    501     sqlite3_mutex_leave(mutex);
   501    502   }
   502    503   
          504  +
          505  +#ifndef SQLITE_OMIT_LOAD_EXTENSION
          506  +
   503    507   /*
   504    508   ** Load all automatic extensions.
   505    509   */
   506    510   int sqlite3AutoLoadExtensions(sqlite3 *db){
   507    511     int i;
   508    512     int go = 1;
   509    513     int rc = SQLITE_OK;
................................................................................
   531    535         go = 0;
   532    536         rc = SQLITE_ERROR;
   533    537         sqlite3_free(zErrmsg);
   534    538       }
   535    539     }
   536    540     return rc;
   537    541   }
          542  +
          543  +#endif /* SQLITE_OMIT_LOADEXTENSION */

Changes to src/test_autoext.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Test extension for testing the sqlite3_auto_extension() function.
    13     13   **
    14         -** $Id: test_autoext.c,v 1.3 2008/03/19 16:08:54 drh Exp $
           14  +** $Id: test_autoext.c,v 1.4 2008/03/19 23:52:35 mlcreech Exp $
    15     15   */
    16     16   #include "tcl.h"
    17         -#ifndef SQLITE_OMIT_LOAD_EXTENSION
    18     17   #include "sqlite3ext.h"
           18  +
           19  +#ifndef SQLITE_OMIT_LOAD_EXTENSION
    19     20   static SQLITE_EXTENSION_INIT1
    20     21   
    21     22   /*
    22     23   ** The sqr() SQL function returns the square of its input value.
    23     24   */
    24     25   static void sqrFunc(
    25     26     sqlite3_context *context,
................................................................................
   123    124     Tcl_Interp *interp,
   124    125     int objc,
   125    126     Tcl_Obj *CONST objv[]
   126    127   ){
   127    128     sqlite3_auto_extension((void*)broken_init);
   128    129     return SQLITE_OK;
   129    130   }
          131  +
          132  +#endif /* SQLITE_OMIT_LOAD_EXTENSION */
          133  +
   130    134   
   131    135   /*
   132    136   ** tclcmd:   sqlite3_reset_auto_extension
   133    137   **
   134    138   ** Reset all auto-extensions
   135    139   */
   136    140   static int resetAutoExtObjCmd(
................................................................................
   140    144     Tcl_Obj *CONST objv[]
   141    145   ){
   142    146     sqlite3_reset_auto_extension();
   143    147     return SQLITE_OK;
   144    148   }
   145    149   
   146    150   
   147         -#endif /* SQLITE_OMIT_LOAD_EXTENSION */
   148         -
   149    151   /*
   150    152   ** This procedure registers the TCL procs defined in this file.
   151    153   */
   152    154   int Sqlitetest_autoext_Init(Tcl_Interp *interp){
   153    155   #ifndef SQLITE_OMIT_LOAD_EXTENSION
   154    156     Tcl_CreateObjCommand(interp, "sqlite3_auto_extension_sqr",
   155    157             autoExtSqrObjCmd, 0, 0);