]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Avoid using the GetVersionEx functions if they are considered deprecated. vs2013
authormistachkin <mistachkin@noemail.net>
Wed, 27 Nov 2013 03:01:34 +0000 (03:01 +0000)
committermistachkin <mistachkin@noemail.net>
Wed, 27 Nov 2013 03:01:34 +0000 (03:01 +0000)
FossilOrigin-Name: 0ea9e4722be10221c99cce5bc48d13c7b34e739f

manifest
manifest.uuid
src/os_win.c

index f3db92f6441e4c2ee3cf74a115a8e0dc08cdf045..16c9cab3ac2a53bc308ad3460ae675c5ccf697ae 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sadditional\stest\scases\sfor\sskip-scan.
-D 2013-11-27T01:23:53.318
+C Avoid\susing\sthe\sGetVersionEx\sfunctions\sif\sthey\sare\sconsidered\sdeprecated.
+D 2013-11-27T03:01:34.176
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -206,7 +206,7 @@ F src/os.c b4ad71336fd96f97776f75587cd9e8218288f5be
 F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f
 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
 F src/os_unix.c 143624d9eabb3b997c59cf594e0d06c56edd43e9
-F src/os_win.c cb3f26205ea785a63ea5bdc21a9c9f9ae3972d0f
+F src/os_win.c 4323dd0bac4f7a7037fc4cf87fb4692d17f0b108
 F src/pager.c 2aa4444ffe86e9282d03bc349a4a5e49bd77c0e8
 F src/pager.h f094af9f6ececfaa8a1e93876905a4f34233fb0c
 F src/parse.y acee1a9958539e21263362b194594c5255ad2fca
@@ -1145,7 +1145,10 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
-P b408d788105efd007e3546f45d5dd15a5dc5688d
-R d4fd41c1f94c9f73ab9606b0e58d8a6b
-U drh
-Z 5fe0b4019eaac7439aed9d81168a0a2a
+P 1ae4915d4d08ee5ce526c04d1d0cda1078641793
+R 1408bb35546f8304605f0cd70b3a2cef
+T *branch * vs2013
+T *sym-vs2013 *
+T -sym-trunk *
+U mistachkin
+Z f9b9e39c0c1855e6c7f8a373135be4dd
index 74f91dc90901addcb44da3e18dcf77bbb7c0d6f6..ed05f2804706b85f0471b8258dc8a2877dd1e6d7 100644 (file)
@@ -1 +1 @@
-1ae4915d4d08ee5ce526c04d1d0cda1078641793
\ No newline at end of file
+0ea9e4722be10221c99cce5bc48d13c7b34e739f
\ No newline at end of file
index 31c4b69df0098221ae15adec5be8b36849f39b01..22052a3fe7c19cb35a0774c81ba001a8031e53ec 100644 (file)
  must be defined."
 #endif
 
+/*
+** Define the required Windows SDK version constants if they are not
+** already available.
+*/
+#ifndef NTDDI_WIN8
+#  define NTDDI_WIN8                        0x06020000
+#endif
+
+#ifndef NTDDI_WINBLUE
+#  define NTDDI_WINBLUE                     0x06030000
+#endif
+
+/*
+** Check if the GetVersionEx[AW] functions should be considered deprecated
+** and avoid using them in that case.  It should be noted here that if the
+** value of the SQLITE_WIN32_GETVERSIONEX pre-processor macro is zero
+** (whether via this block or via being manually specified), that implies
+** the underlying operating system will always be based on the Windows NT
+** Kernel.
+*/
+#ifndef SQLITE_WIN32_GETVERSIONEX
+#  if defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WINBLUE
+#    define SQLITE_WIN32_GETVERSIONEX   0
+#  else
+#    define SQLITE_WIN32_GETVERSIONEX   1
+#  endif
+#endif
+
 /*
 ** This constant should already be defined (in the "WinDef.h" SDK file).
 */
@@ -694,7 +722,8 @@ static struct win_syscall {
 
 #define osGetTickCount ((DWORD(WINAPI*)(VOID))aSyscall[33].pCurrent)
 
-#if defined(SQLITE_WIN32_HAS_ANSI)
+#if defined(SQLITE_WIN32_HAS_ANSI) && defined(SQLITE_WIN32_GETVERSIONEX) && \
+        SQLITE_WIN32_GETVERSIONEX
   { "GetVersionExA",           (SYSCALL)GetVersionExA,           0 },
 #else
   { "GetVersionExA",           (SYSCALL)0,                       0 },
@@ -703,7 +732,8 @@ static struct win_syscall {
 #define osGetVersionExA ((BOOL(WINAPI*)( \
         LPOSVERSIONINFOA))aSyscall[34].pCurrent)
 
-#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE)
+#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE) && \
+        defined(SQLITE_WIN32_GETVERSIONEX) && SQLITE_WIN32_GETVERSIONEX
   { "GetVersionExW",           (SYSCALL)GetVersionExW,           0 },
 #else
   { "GetVersionExW",           (SYSCALL)0,                       0 },
@@ -1260,11 +1290,10 @@ void sqlite3_win32_sleep(DWORD milliseconds){
 ** WinNT/2K/XP so that we will know whether or not we can safely call
 ** the LockFileEx() API.
 */
-#ifndef NTDDI_WIN8
-#  define NTDDI_WIN8                        0x06020000
-#endif
 
-#if SQLITE_OS_WINCE || SQLITE_OS_WINRT || !defined(SQLITE_WIN32_HAS_ANSI)
+#if !defined(SQLITE_WIN32_GETVERSIONEX) || !SQLITE_WIN32_GETVERSIONEX
+# define osIsNT()  (1)
+#elif SQLITE_OS_WINCE || SQLITE_OS_WINRT || !defined(SQLITE_WIN32_HAS_ANSI)
 # define osIsNT()  (1)
 #elif !defined(SQLITE_WIN32_HAS_WIDE)
 # define osIsNT()  (0)