/ Check-in [5f6e3580]
Login

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

Overview
Comment:Fix build with OSTRACE enabled on Windows when building using separate source files.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winTest
Files: files | file ages | folders
SHA1: 5f6e35802fcf7b5e9fc3dd4424e9074523fa8ad3
User & Date: mistachkin 2015-04-02 17:46:52
Context
2015-04-04
00:02
Enhance the 'releasetest.tcl' tool to support MSVC. check-in: f664bfdc user: mistachkin tags: winTest
2015-04-02
17:46
Fix build with OSTRACE enabled on Windows when building using separate source files. check-in: 5f6e3580 user: mistachkin tags: winTest
2015-04-01
01:26
The build is still broken. Multiple definitions of sqlite3OSTrace when compiled using separate source files. check-in: 5c965a71 user: drh tags: winTest
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

    51     51   
    52     52   /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
    53     53   ** zero if and only if SQLite was compiled with mutexing code omitted due to
    54     54   ** the SQLITE_THREADSAFE compile-time option being set to 0.
    55     55   */
    56     56   int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
    57     57   
           58  +/*
           59  +** When compiling the test fixture or with debugging enabled (on Win32),
           60  +** this variable being set to non-zero will cause OSTRACE macros to emit
           61  +** extra diagnostic information.
           62  +*/
           63  +#if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || \
           64  +    (defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE))
           65  +# ifndef SQLITE_DEBUG_OS_TRACE
           66  +#   define SQLITE_DEBUG_OS_TRACE 0
           67  +# endif
           68  +  int sqlite3OSTrace = SQLITE_DEBUG_OS_TRACE;
           69  +#endif
           70  +
    58     71   #if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE)
    59     72   /*
    60     73   ** If the following function pointer is not NULL and if
    61     74   ** SQLITE_ENABLE_IOTRACE is enabled, then messages describing
    62     75   ** I/O active are written using this function.  These messages
    63     76   ** are intended for debugging activity only.
    64     77   */

Changes to src/os_common.h.

    25     25   ** macro to SQLITE_DEBUG and some older makefiles have not yet made the
    26     26   ** switch.  The following code should catch this problem at compile-time.
    27     27   */
    28     28   #ifdef MEMORY_DEBUG
    29     29   # error "The MEMORY_DEBUG macro is obsolete.  Use SQLITE_DEBUG instead."
    30     30   #endif
    31     31   
           32  +/*
           33  +** Declarations used for tracing the operating system interfaces.
           34  +*/
    32     35   #if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || \
    33     36       (defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE))
    34         -# ifndef SQLITE_DEBUG_OS_TRACE
    35         -#   define SQLITE_DEBUG_OS_TRACE 0
    36         -# endif
    37         -  int sqlite3OSTrace = SQLITE_DEBUG_OS_TRACE;
           37  +  extern int sqlite3OSTrace;
    38     38   # define OSTRACE(X)          if( sqlite3OSTrace ) sqlite3DebugPrintf X
    39     39   #else
    40     40   # define OSTRACE(X)
    41     41   #endif
    42     42   
    43     43   /*
    44     44   ** Macros for performance tracing.  Normally turned off.  Only works