/ Check-in [0d42c6b8]
Login

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

Overview
Comment:Initial work on isolating usage of the Windows header file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winHdr
Files: files | file ages | folders
SHA1: 0d42c6b830ee50f45539d73e3948ed3bc50a11d1
User & Date: mistachkin 2013-11-25 09:36:07
Context
2013-11-25
09:37
Correct line-endings in the new header file. check-in: 94219b9f user: mistachkin tags: winHdr
09:36
Initial work on isolating usage of the Windows header file. check-in: 0d42c6b8 user: mistachkin tags: winHdr
2013-11-24
01:14
Add the --scratch parameter to speedtest1. Improved error messages when misconfiguring memory parameters in speedtest1. check-in: 8f3c767a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

   237    237     $(TOP)/src/mutex_w32.c \
   238    238     $(TOP)/src/notify.c \
   239    239     $(TOP)/src/os.c \
   240    240     $(TOP)/src/os.h \
   241    241     $(TOP)/src/os_common.h \
   242    242     $(TOP)/src/os_unix.c \
   243    243     $(TOP)/src/os_win.c \
          244  +  $(TOP)/src/os_win.h \
   244    245     $(TOP)/src/pager.c \
   245    246     $(TOP)/src/pager.h \
   246    247     $(TOP)/src/parse.y \
   247    248     $(TOP)/src/pcache.c \
   248    249     $(TOP)/src/pcache.h \
   249    250     $(TOP)/src/pcache1.c \
   250    251     $(TOP)/src/pragma.c \
................................................................................
   453    454      $(TOP)/src/hash.h \
   454    455      $(TOP)/src/hwtime.h \
   455    456      keywordhash.h \
   456    457      $(TOP)/src/mutex.h \
   457    458      opcodes.h \
   458    459      $(TOP)/src/os.h \
   459    460      $(TOP)/src/os_common.h \
          461  +   $(TOP)/src/os_win.h \
   460    462      $(TOP)/src/pager.h \
   461    463      $(TOP)/src/pcache.h \
   462    464      parse.h  \
   463    465      sqlite3.h  \
   464    466      $(TOP)/src/sqlite3ext.h \
   465    467      $(TOP)/src/sqliteInt.h  \
   466    468      $(TOP)/src/sqliteLimit.h \

Changes to Makefile.msc.

   624    624     $(TOP)\src\mutex_w32.c \
   625    625     $(TOP)\src\notify.c \
   626    626     $(TOP)\src\os.c \
   627    627     $(TOP)\src\os.h \
   628    628     $(TOP)\src\os_common.h \
   629    629     $(TOP)\src\os_unix.c \
   630    630     $(TOP)\src\os_win.c \
          631  +  $(TOP)\src\os_win.h \
   631    632     $(TOP)\src\pager.c \
   632    633     $(TOP)\src\pager.h \
   633    634     $(TOP)\src\parse.y \
   634    635     $(TOP)\src\pcache.c \
   635    636     $(TOP)\src\pcache.h \
   636    637     $(TOP)\src\pcache1.c \
   637    638     $(TOP)\src\pragma.c \
................................................................................
   843    844      $(TOP)\src\hash.h \
   844    845      $(TOP)\src\hwtime.h \
   845    846      keywordhash.h \
   846    847      $(TOP)\src\mutex.h \
   847    848      opcodes.h \
   848    849      $(TOP)\src\os.h \
   849    850      $(TOP)\src\os_common.h \
          851  +   $(TOP)\src\os_win.h \
   850    852      $(TOP)\src\pager.h \
   851    853      $(TOP)\src\pcache.h \
   852    854      parse.h \
   853    855      sqlite3.h \
   854    856      $(TOP)\src\sqlite3ext.h \
   855    857      $(TOP)\src\sqliteInt.h \
   856    858      $(TOP)\src\sqliteLimit.h \

Changes to Makefile.vxworks.

   260    260     $(TOP)/src/mutex_w32.c \
   261    261     $(TOP)/src/notify.c \
   262    262     $(TOP)/src/os.c \
   263    263     $(TOP)/src/os.h \
   264    264     $(TOP)/src/os_common.h \
   265    265     $(TOP)/src/os_unix.c \
   266    266     $(TOP)/src/os_win.c \
          267  +  $(TOP)/src/os_win.h \
   267    268     $(TOP)/src/pager.c \
   268    269     $(TOP)/src/pager.h \
   269    270     $(TOP)/src/parse.y \
   270    271     $(TOP)/src/pcache.c \
   271    272     $(TOP)/src/pcache.h \
   272    273     $(TOP)/src/pcache1.c \
   273    274     $(TOP)/src/pragma.c \
................................................................................
   412    413      $(TOP)/src/hash.h \
   413    414      $(TOP)/src/hwtime.h \
   414    415      keywordhash.h \
   415    416      $(TOP)/src/mutex.h \
   416    417      opcodes.h \
   417    418      $(TOP)/src/os.h \
   418    419      $(TOP)/src/os_common.h \
          420  +   $(TOP)/src/os_win.h \
   419    421      $(TOP)/src/pager.h \
   420    422      $(TOP)/src/pcache.h \
   421    423      parse.h  \
   422    424      sqlite3.h  \
   423    425      $(TOP)/src/sqlite3ext.h \
   424    426      $(TOP)/src/sqliteInt.h  \
   425    427      $(TOP)/src/sqliteLimit.h \

Changes to main.mk.

   119    119     $(TOP)/src/mutex_w32.c \
   120    120     $(TOP)/src/notify.c \
   121    121     $(TOP)/src/os.c \
   122    122     $(TOP)/src/os.h \
   123    123     $(TOP)/src/os_common.h \
   124    124     $(TOP)/src/os_unix.c \
   125    125     $(TOP)/src/os_win.c \
          126  +  $(TOP)/src/os_win.h \
   126    127     $(TOP)/src/pager.c \
   127    128     $(TOP)/src/pager.h \
   128    129     $(TOP)/src/parse.y \
   129    130     $(TOP)/src/pcache.c \
   130    131     $(TOP)/src/pcache.h \
   131    132     $(TOP)/src/pcache1.c \
   132    133     $(TOP)/src/pragma.c \
................................................................................
   335    336      $(TOP)/src/hash.h \
   336    337      $(TOP)/src/hwtime.h \
   337    338      keywordhash.h \
   338    339      $(TOP)/src/mutex.h \
   339    340      opcodes.h \
   340    341      $(TOP)/src/os.h \
   341    342      $(TOP)/src/os_common.h \
          343  +   $(TOP)/src/os_win.h \
   342    344      $(TOP)/src/pager.h \
   343    345      $(TOP)/src/pcache.h \
   344    346      parse.h  \
   345    347      sqlite3.h  \
   346    348      $(TOP)/src/sqlite3ext.h \
   347    349      $(TOP)/src/sqliteInt.h  \
   348    350      $(TOP)/src/sqliteLimit.h \

Changes to src/mutex_w32.c.

    15     15   
    16     16   /*
    17     17   ** The code in this file is only used if we are compiling multithreaded
    18     18   ** on a win32 system.
    19     19   */
    20     20   #ifdef SQLITE_MUTEX_W32
    21     21   
           22  +/*
           23  +** Include the header file for the Windows VFS.
           24  +*/
           25  +#include "os_win.h"
           26  +
    22     27   /*
    23     28   ** Each recursive mutex is an instance of the following structure.
    24     29   */
    25     30   struct sqlite3_mutex {
    26     31     CRITICAL_SECTION mutex;    /* Mutex controlling the lock */
    27     32     int id;                    /* Mutex type */
    28     33   #ifdef SQLITE_DEBUG

Changes to src/os.h.

    52     52   # endif
    53     53   #else
    54     54   # ifndef SQLITE_OS_WIN
    55     55   #  define SQLITE_OS_WIN 0
    56     56   # endif
    57     57   #endif
    58     58   
    59         -#if SQLITE_OS_WIN
    60         -# include <windows.h>
    61         -#endif
    62         -
    63         -/*
    64         -** Determine if we are dealing with Windows NT.
    65         -**
    66         -** We ought to be able to determine if we are compiling for win98 or winNT
    67         -** using the _WIN32_WINNT macro as follows:
    68         -**
    69         -** #if defined(_WIN32_WINNT)
    70         -** # define SQLITE_OS_WINNT 1
    71         -** #else
    72         -** # define SQLITE_OS_WINNT 0
    73         -** #endif
    74         -**
    75         -** However, vs2005 does not set _WIN32_WINNT by default, as it ought to,
    76         -** so the above test does not work.  We'll just assume that everything is
    77         -** winNT unless the programmer explicitly says otherwise by setting
    78         -** SQLITE_OS_WINNT to 0.
    79         -*/
    80         -#if SQLITE_OS_WIN && !defined(SQLITE_OS_WINNT)
    81         -# define SQLITE_OS_WINNT 1
    82         -#endif
    83         -
    84         -/*
    85         -** Determine if we are dealing with WindowsCE - which has a much
    86         -** reduced API.
    87         -*/
    88         -#if defined(_WIN32_WCE)
    89         -# define SQLITE_OS_WINCE 1
    90         -#else
    91         -# define SQLITE_OS_WINCE 0
    92         -#endif
    93         -
    94         -/*
    95         -** Determine if we are dealing with WinRT, which provides only a subset of
    96         -** the full Win32 API.
    97         -*/
    98         -#if !defined(SQLITE_OS_WINRT)
    99         -# define SQLITE_OS_WINRT 0
   100         -#endif
   101         -
   102     59   /* If the SET_FULLSYNC macro is not defined above, then make it
   103     60   ** a no-op
   104     61   */
   105     62   #ifndef SET_FULLSYNC
   106     63   # define SET_FULLSYNC(x,y)
   107     64   #endif
   108     65   

Changes to src/os_win.c.

    11     11   ******************************************************************************
    12     12   **
    13     13   ** This file contains code that is specific to Windows.
    14     14   */
    15     15   #include "sqliteInt.h"
    16     16   #if SQLITE_OS_WIN               /* This file is used for Windows only */
    17     17   
    18         -#ifdef __CYGWIN__
    19         -# include <sys/cygwin.h>
    20         -# include <errno.h> /* amalgamator: keep */
    21         -#endif
    22         -
    23     18   /*
    24     19   ** Include code that is common to all os_*.c files
    25     20   */
    26     21   #include "os_common.h"
    27     22   
           23  +/*
           24  +** Include the header file for the Windows VFS.
           25  +*/
           26  +#include "os_win.h"
           27  +
    28     28   /*
    29     29   ** Compiling and using WAL mode requires several APIs that are only
    30     30   ** available in Windows platforms based on the NT kernel.
    31     31   */
    32     32   #if !SQLITE_OS_WINNT && !defined(SQLITE_OMIT_WAL)
    33     33   #  error "WAL mode requires support from the Windows NT kernel, compile\
    34     34    with SQLITE_OMIT_WAL."

Added src/os_win.h.

            1  +/*
            2  +** 2013 November 25
            3  +**
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
            6  +**
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
           10  +**
           11  +******************************************************************************
           12  +**
           13  +** This file contains code that is specific to Windows.
           14  +*/
           15  +#ifndef _OS_WIN_H_
           16  +#define _OS_WIN_H_
           17  +
           18  +/*
           19  +** Include the Windows SDK header file.
           20  +*/
           21  +#include "windows.h"
           22  +
           23  +#ifdef __CYGWIN__
           24  +# include <sys/cygwin.h>
           25  +# include <errno.h> /* amalgamator: keep */
           26  +#endif
           27  +
           28  +/*
           29  +** Determine if we are dealing with Windows NT.
           30  +**
           31  +** We ought to be able to determine if we are compiling for win98 or winNT
           32  +** using the _WIN32_WINNT macro as follows:
           33  +**
           34  +** #if defined(_WIN32_WINNT)
           35  +** # define SQLITE_OS_WINNT 1
           36  +** #else
           37  +** # define SQLITE_OS_WINNT 0
           38  +** #endif
           39  +**
           40  +** However, vs2005 does not set _WIN32_WINNT by default, as it ought to,
           41  +** so the above test does not work.  We'll just assume that everything is
           42  +** winNT unless the programmer explicitly says otherwise by setting
           43  +** SQLITE_OS_WINNT to 0.
           44  +*/
           45  +#if SQLITE_OS_WIN && !defined(SQLITE_OS_WINNT)
           46  +# define SQLITE_OS_WINNT 1
           47  +#endif
           48  +
           49  +/*
           50  +** Determine if we are dealing with WindowsCE - which has a much
           51  +** reduced API.
           52  +*/
           53  +#if defined(_WIN32_WCE)
           54  +# define SQLITE_OS_WINCE 1
           55  +#else
           56  +# define SQLITE_OS_WINCE 0
           57  +#endif
           58  +
           59  +/*
           60  +** Determine if we are dealing with WinRT, which provides only a subset of
           61  +** the full Win32 API.
           62  +*/
           63  +#if !defined(SQLITE_OS_WINRT)
           64  +# define SQLITE_OS_WINRT 0
           65  +#endif
           66  +
           67  +#endif /* _OS_WIN_H_ */

Changes to tool/mksqlite3c-noext.tcl.

    95     95      btreeInt.h
    96     96      hash.h
    97     97      hwtime.h
    98     98      keywordhash.h
    99     99      mutex.h
   100    100      opcodes.h
   101    101      os_common.h
          102  +   os_win.h
   102    103      os.h
   103    104      pager.h
   104    105      parse.h
   105    106      pcache.h
   106    107      sqlite3ext.h
   107    108      sqlite3.h
   108    109      sqliteicu.h

Changes to tool/mksqlite3c.tcl.

    99     99      fts3_tokenizer.h
   100    100      hash.h
   101    101      hwtime.h
   102    102      keywordhash.h
   103    103      mutex.h
   104    104      opcodes.h
   105    105      os_common.h
          106  +   os_win.h
   106    107      os.h
   107    108      pager.h
   108    109      parse.h
   109    110      pcache.h
   110    111      rtree.h
   111    112      sqlite3ext.h
   112    113      sqlite3.h

Changes to tool/mksqlite3internalh.tcl.

    56     56      btree.h
    57     57      btreeInt.h
    58     58      hash.h
    59     59      hwtime.h
    60     60      keywordhash.h
    61     61      opcodes.h
    62     62      os_common.h
           63  +   os_win.h
    63     64      os.h
    64     65      pager.h
    65     66      parse.h
    66     67      sqlite3ext.h
    67     68      sqlite3.h
    68     69      sqliteInt.h
    69     70      sqliteLimit.h