1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Initial work on isolating usage of the Windows header file.

FossilOrigin-Name: 0d42c6b830ee50f45539d73e3948ed3bc50a11d1
This commit is contained in:
mistachkin
2013-11-25 09:36:07 +00:00
parent 93307e9d06
commit 8bc5262915
13 changed files with 109 additions and 65 deletions

View File

@@ -241,6 +241,7 @@ SRC = \
$(TOP)/src/os_common.h \ $(TOP)/src/os_common.h \
$(TOP)/src/os_unix.c \ $(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \ $(TOP)/src/os_win.c \
$(TOP)/src/os_win.h \
$(TOP)/src/pager.c \ $(TOP)/src/pager.c \
$(TOP)/src/pager.h \ $(TOP)/src/pager.h \
$(TOP)/src/parse.y \ $(TOP)/src/parse.y \
@@ -457,6 +458,7 @@ HDR = \
opcodes.h \ opcodes.h \
$(TOP)/src/os.h \ $(TOP)/src/os.h \
$(TOP)/src/os_common.h \ $(TOP)/src/os_common.h \
$(TOP)/src/os_win.h \
$(TOP)/src/pager.h \ $(TOP)/src/pager.h \
$(TOP)/src/pcache.h \ $(TOP)/src/pcache.h \
parse.h \ parse.h \

View File

@@ -628,6 +628,7 @@ SRC = \
$(TOP)\src\os_common.h \ $(TOP)\src\os_common.h \
$(TOP)\src\os_unix.c \ $(TOP)\src\os_unix.c \
$(TOP)\src\os_win.c \ $(TOP)\src\os_win.c \
$(TOP)\src\os_win.h \
$(TOP)\src\pager.c \ $(TOP)\src\pager.c \
$(TOP)\src\pager.h \ $(TOP)\src\pager.h \
$(TOP)\src\parse.y \ $(TOP)\src\parse.y \
@@ -847,6 +848,7 @@ HDR = \
opcodes.h \ opcodes.h \
$(TOP)\src\os.h \ $(TOP)\src\os.h \
$(TOP)\src\os_common.h \ $(TOP)\src\os_common.h \
$(TOP)\src\os_win.h \
$(TOP)\src\pager.h \ $(TOP)\src\pager.h \
$(TOP)\src\pcache.h \ $(TOP)\src\pcache.h \
parse.h \ parse.h \

View File

@@ -264,6 +264,7 @@ SRC = \
$(TOP)/src/os_common.h \ $(TOP)/src/os_common.h \
$(TOP)/src/os_unix.c \ $(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \ $(TOP)/src/os_win.c \
$(TOP)/src/os_win.h \
$(TOP)/src/pager.c \ $(TOP)/src/pager.c \
$(TOP)/src/pager.h \ $(TOP)/src/pager.h \
$(TOP)/src/parse.y \ $(TOP)/src/parse.y \
@@ -416,6 +417,7 @@ HDR = \
opcodes.h \ opcodes.h \
$(TOP)/src/os.h \ $(TOP)/src/os.h \
$(TOP)/src/os_common.h \ $(TOP)/src/os_common.h \
$(TOP)/src/os_win.h \
$(TOP)/src/pager.h \ $(TOP)/src/pager.h \
$(TOP)/src/pcache.h \ $(TOP)/src/pcache.h \
parse.h \ parse.h \

View File

@@ -123,6 +123,7 @@ SRC = \
$(TOP)/src/os_common.h \ $(TOP)/src/os_common.h \
$(TOP)/src/os_unix.c \ $(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \ $(TOP)/src/os_win.c \
$(TOP)/src/os_win.h \
$(TOP)/src/pager.c \ $(TOP)/src/pager.c \
$(TOP)/src/pager.h \ $(TOP)/src/pager.h \
$(TOP)/src/parse.y \ $(TOP)/src/parse.y \
@@ -339,6 +340,7 @@ HDR = \
opcodes.h \ opcodes.h \
$(TOP)/src/os.h \ $(TOP)/src/os.h \
$(TOP)/src/os_common.h \ $(TOP)/src/os_common.h \
$(TOP)/src/os_win.h \
$(TOP)/src/pager.h \ $(TOP)/src/pager.h \
$(TOP)/src/pcache.h \ $(TOP)/src/pcache.h \
parse.h \ parse.h \

View File

@@ -1,10 +1,10 @@
C Add\sthe\s--scratch\sparameter\sto\sspeedtest1.\s\sImproved\serror\smessages\swhen\nmisconfiguring\smemory\sparameters\sin\sspeedtest1. C Initial\swork\son\sisolating\susage\sof\sthe\sWindows\sheader\sfile.
D 2013-11-24T01:14:14.123 D 2013-11-25T09:36:07.707
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b F Makefile.in 16254fb023b7e69788013f0da5ccdc2063ba2328
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc a6247094079f3ef97dcd7a69d0e13ff718c7073e F Makefile.msc 7e91dccedae82c45dbf91a4e8240c642c2b90c83
F Makefile.vxworks db21ed42a01d5740e656b16f92cb5d8d5e5dd315 F Makefile.vxworks f921bd6a0600e36d67da080d820ae712ab393f30
F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
F VERSION 52f7e22bfcec71a462e34194b4ae1671380fde59 F VERSION 52f7e22bfcec71a462e34194b4ae1671380fde59
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
@@ -142,7 +142,7 @@ F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt f439556c5ce01ced70987e5ee86549a45165d9ff F magic.txt f439556c5ce01ced70987e5ee86549a45165d9ff
F main.mk 82fd90375561d7b66287ae5a8b09e1e027394019 F main.mk c9b6d61c55f461543244d63992c63037c3f11dac
F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
F mkextw.sh d2a981497b404d6498f5ff3e3b1f3816bdfcb338 F mkextw.sh d2a981497b404d6498f5ff3e3b1f3816bdfcb338
@@ -200,13 +200,14 @@ F src/mutex.c d3b66a569368015e0fcb1ac15f81c119f504d3bc
F src/mutex.h 5bc526e19dccc412b7ff04642f6fdad3fdfdabea F src/mutex.h 5bc526e19dccc412b7ff04642f6fdad3fdfdabea
F src/mutex_noop.c 7682796b7d8d39bf1c138248858efcd10c9e1553 F src/mutex_noop.c 7682796b7d8d39bf1c138248858efcd10c9e1553
F src/mutex_unix.c c3a4e00f96ba068a8dbef34084465979aaf369cc F src/mutex_unix.c c3a4e00f96ba068a8dbef34084465979aaf369cc
F src/mutex_w32.c 6108c88e1cb38d8fbb3534b170793815cbedbf97 F src/mutex_w32.c ab08c0fc54b71979370ca7c8f42fc64a9f211ebb
F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30 F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30
F src/os.c b4ad71336fd96f97776f75587cd9e8218288f5be F src/os.c b4ad71336fd96f97776f75587cd9e8218288f5be
F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f F src/os.h cd8fd6545d6a936bae05026136324ec8e620c7f8
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_unix.c 143624d9eabb3b997c59cf594e0d06c56edd43e9 F src/os_unix.c 143624d9eabb3b997c59cf594e0d06c56edd43e9
F src/os_win.c ef091b347d682cb24fc575ac9a6290341af62e2b F src/os_win.c 423d8f815067f4980cb84abab501374afc9bd039
F src/os_win.h db1d1d18f56ea2931ba1c2ec25ff4616ae1e581b
F src/pager.c 2aa4444ffe86e9282d03bc349a4a5e49bd77c0e8 F src/pager.c 2aa4444ffe86e9282d03bc349a4a5e49bd77c0e8
F src/pager.h f094af9f6ececfaa8a1e93876905a4f34233fb0c F src/pager.h f094af9f6ececfaa8a1e93876905a4f34233fb0c
F src/parse.y acee1a9958539e21263362b194594c5255ad2fca F src/parse.y acee1a9958539e21263362b194594c5255ad2fca
@@ -1111,10 +1112,10 @@ F tool/mkkeywordhash.c 189d76644e373c7d0864c628deb8ce7b4f403591
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkpragmatab.tcl 78a77b2c554d534c6f2dc903130186ed15715460 F tool/mkpragmatab.tcl 78a77b2c554d534c6f2dc903130186ed15715460
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl 8bce31074e4cbe631bb7676526a048335f4c9f02 F tool/mksqlite3c-noext.tcl 1407684f6781496421be53841f1259303f0c8be9
F tool/mksqlite3c.tcl e2ba20d3f690990079d17f3e5a7417dfb7ada543 F tool/mksqlite3c.tcl c6b22da4d4ee272afda33f0aeb896d9c2e26dc95
F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12 F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12
F tool/mksqlite3internalh.tcl 3dca7bb5374cee003379b8cbac73714f610ef795 F tool/mksqlite3internalh.tcl ba0532989220eaef044cbb8c0108eca623d23bbc
F tool/mkvsix.tcl 6477fb9dab838b7eea1eed50658ff1cda04850b5 F tool/mkvsix.tcl 6477fb9dab838b7eea1eed50658ff1cda04850b5
F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091 F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091
F tool/omittest.tcl 4665982e95a6e5c1bd806cf7bc3dea95be422d77 F tool/omittest.tcl 4665982e95a6e5c1bd806cf7bc3dea95be422d77
@@ -1142,7 +1143,10 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P 12e612e8e7c4a6f83acf0daf5608151fb5ec1575 P 8f3c767a30c552548ead104ca125f182ce4849ad
R d231270eb8540c71c1fe43ad7f945ecf R e592d18e44da45424fc95ed6d55c4c01
U drh T *branch * winHdr
Z 904197ecb3cb4ac430a652007d0a071c T *sym-winHdr *
T -sym-trunk *
U mistachkin
Z 4118ce5841a2a285e11b8bcc9d8fe99e

View File

@@ -1 +1 @@
8f3c767a30c552548ead104ca125f182ce4849ad 0d42c6b830ee50f45539d73e3948ed3bc50a11d1

View File

@@ -19,6 +19,11 @@
*/ */
#ifdef SQLITE_MUTEX_W32 #ifdef SQLITE_MUTEX_W32
/*
** Include the header file for the Windows VFS.
*/
#include "os_win.h"
/* /*
** Each recursive mutex is an instance of the following structure. ** Each recursive mutex is an instance of the following structure.
*/ */

View File

@@ -56,49 +56,6 @@
# endif # endif
#endif #endif
#if SQLITE_OS_WIN
# include <windows.h>
#endif
/*
** Determine if we are dealing with Windows NT.
**
** We ought to be able to determine if we are compiling for win98 or winNT
** using the _WIN32_WINNT macro as follows:
**
** #if defined(_WIN32_WINNT)
** # define SQLITE_OS_WINNT 1
** #else
** # define SQLITE_OS_WINNT 0
** #endif
**
** However, vs2005 does not set _WIN32_WINNT by default, as it ought to,
** so the above test does not work. We'll just assume that everything is
** winNT unless the programmer explicitly says otherwise by setting
** SQLITE_OS_WINNT to 0.
*/
#if SQLITE_OS_WIN && !defined(SQLITE_OS_WINNT)
# define SQLITE_OS_WINNT 1
#endif
/*
** Determine if we are dealing with WindowsCE - which has a much
** reduced API.
*/
#if defined(_WIN32_WCE)
# define SQLITE_OS_WINCE 1
#else
# define SQLITE_OS_WINCE 0
#endif
/*
** Determine if we are dealing with WinRT, which provides only a subset of
** the full Win32 API.
*/
#if !defined(SQLITE_OS_WINRT)
# define SQLITE_OS_WINRT 0
#endif
/* If the SET_FULLSYNC macro is not defined above, then make it /* If the SET_FULLSYNC macro is not defined above, then make it
** a no-op ** a no-op
*/ */

View File

@@ -15,16 +15,16 @@
#include "sqliteInt.h" #include "sqliteInt.h"
#if SQLITE_OS_WIN /* This file is used for Windows only */ #if SQLITE_OS_WIN /* This file is used for Windows only */
#ifdef __CYGWIN__
# include <sys/cygwin.h>
# include <errno.h> /* amalgamator: keep */
#endif
/* /*
** Include code that is common to all os_*.c files ** Include code that is common to all os_*.c files
*/ */
#include "os_common.h" #include "os_common.h"
/*
** Include the header file for the Windows VFS.
*/
#include "os_win.h"
/* /*
** Compiling and using WAL mode requires several APIs that are only ** Compiling and using WAL mode requires several APIs that are only
** available in Windows platforms based on the NT kernel. ** available in Windows platforms based on the NT kernel.

67
src/os_win.h Normal file
View File

@@ -0,0 +1,67 @@
/*
** 2013 November 25
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
** This file contains code that is specific to Windows.
*/
#ifndef _OS_WIN_H_
#define _OS_WIN_H_
/*
** Include the Windows SDK header file.
*/
#include "windows.h"
#ifdef __CYGWIN__
# include <sys/cygwin.h>
# include <errno.h> /* amalgamator: keep */
#endif
/*
** Determine if we are dealing with Windows NT.
**
** We ought to be able to determine if we are compiling for win98 or winNT
** using the _WIN32_WINNT macro as follows:
**
** #if defined(_WIN32_WINNT)
** # define SQLITE_OS_WINNT 1
** #else
** # define SQLITE_OS_WINNT 0
** #endif
**
** However, vs2005 does not set _WIN32_WINNT by default, as it ought to,
** so the above test does not work. We'll just assume that everything is
** winNT unless the programmer explicitly says otherwise by setting
** SQLITE_OS_WINNT to 0.
*/
#if SQLITE_OS_WIN && !defined(SQLITE_OS_WINNT)
# define SQLITE_OS_WINNT 1
#endif
/*
** Determine if we are dealing with WindowsCE - which has a much
** reduced API.
*/
#if defined(_WIN32_WCE)
# define SQLITE_OS_WINCE 1
#else
# define SQLITE_OS_WINCE 0
#endif
/*
** Determine if we are dealing with WinRT, which provides only a subset of
** the full Win32 API.
*/
#if !defined(SQLITE_OS_WINRT)
# define SQLITE_OS_WINRT 0
#endif
#endif /* _OS_WIN_H_ */

View File

@@ -99,6 +99,7 @@ foreach hdr {
mutex.h mutex.h
opcodes.h opcodes.h
os_common.h os_common.h
os_win.h
os.h os.h
pager.h pager.h
parse.h parse.h

View File

@@ -103,6 +103,7 @@ foreach hdr {
mutex.h mutex.h
opcodes.h opcodes.h
os_common.h os_common.h
os_win.h
os.h os.h
pager.h pager.h
parse.h parse.h

View File

@@ -60,6 +60,7 @@ foreach hdr {
keywordhash.h keywordhash.h
opcodes.h opcodes.h
os_common.h os_common.h
os_win.h
os.h os.h
pager.h pager.h
parse.h parse.h