/ Check-in [9fe0f075]
Login

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

Overview
Comment:Revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winrt
Files: files | file ages | folders
SHA1: 9fe0f0754c063c17fffa9d4814b7180397cf5226
User & Date: mistachkin 2014-08-22 19:12:16
Context
2014-09-01
19:29
For sqlite3_win32_is_nt(), assume WinRT is NT-based and revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available. check-in: be0a0372 user: mistachkin tags: trunk
2014-08-22
19:12
Revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available. Closed-Leaf check-in: 9fe0f075 user: mistachkin tags: winrt
2014-08-21
19:11
For sqlite3_win32_is_nt(), assume WinRT is NT-based. check-in: 2f59e71f user: mistachkin tags: winrt
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  1321   1321     /*
  1322   1322     ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
  1323   1323     **       kernel.
  1324   1324     */
  1325   1325     return 1;
  1326   1326   #elif defined(SQLITE_WIN32_GETVERSIONEX) && SQLITE_WIN32_GETVERSIONEX
  1327   1327     if( osInterlockedCompareExchange(&sqlite3_os_type, 0, 0)==0 ){
  1328         -#if defined(SQLITE_WIN32_HAS_WIDE)
         1328  +#if defined(SQLITE_WIN32_HAS_ANSI)
         1329  +    OSVERSIONINFOA sInfo;
         1330  +    sInfo.dwOSVersionInfoSize = sizeof(sInfo);
         1331  +    osGetVersionExA(&sInfo);
         1332  +    osInterlockedCompareExchange(&sqlite3_os_type,
         1333  +        (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
         1334  +#elif defined(SQLITE_WIN32_HAS_WIDE)
  1329   1335       OSVERSIONINFOW sInfo;
  1330   1336       sInfo.dwOSVersionInfoSize = sizeof(sInfo);
  1331   1337       osGetVersionExW(&sInfo);
  1332         -    osInterlockedCompareExchange(&sqlite3_os_type,
  1333         -        (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
  1334         -#elif defined(SQLITE_WIN32_HAS_ANSI)
  1335         -    OSVERSIONINFOA sInfo;
  1336         -    sInfo.dwOSVersionInfoSize = sizeof(sInfo);
  1337         -    osGetVersionExA(&sInfo);
  1338   1338       osInterlockedCompareExchange(&sqlite3_os_type,
  1339   1339           (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
  1340   1340   #endif
  1341   1341     }
  1342   1342     return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
  1343   1343   #elif SQLITE_TEST
  1344   1344     return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;