Skip to content

Commit bb34496

Browse files
committed
Explicitly default the expected Windows API to 0x0A00 (Windows 10)
* Reject versions before Windows 7 (0x0601) * Ensure firebird.h is included first to avoid translation units unexpectedly using a different version or other config than defined in firebird.h * Also raise libcds expected Windows API to Windows 7 (0x601) instead of Windows 2000 (0x0500)/Windows XP (0x501)
1 parent ab0bd5a commit bb34496

File tree

11 files changed

+49
-66
lines changed

11 files changed

+49
-66
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ if (MINGW)
204204
set(CMAKE_SHARED_MODULE_PREFIX)
205205
set(CMAKE_STATIC_LIBRARY_PREFIX)
206206

207-
add_definitions(-D_WIN32_WINNT=0x0600)
207+
# 0x0A00 is Windows 10
208+
add_definitions(-D_WIN32_WINNT=0x0A00)
208209
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4 -std=c++20")
209210
endif()
210211

extern/libcds/projects/Win/vc141/cds.vcxproj

Lines changed: 24 additions & 24 deletions
Large diffs are not rendered by default.

src/common/classes/fb_string.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@
2929
#ifndef INCLUDE_FB_STRING_H
3030
#define INCLUDE_FB_STRING_H
3131

32+
#include "firebird.h"
33+
3234
#include <stdio.h>
3335
#include <string.h>
3436
#include <stdarg.h>
3537
#include <utility>
3638

37-
#include "firebird.h"
3839
#include "fb_types.h"
3940
#include "fb_exception.h"
4041
#include "../common/classes/alloc.h"

src/common/classes/locks.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
* Contributor(s): ______________________________________.
2626
*/
2727

28-
#ifndef __MINGW32__
29-
#define _WIN32_WINNT 0x0403
30-
#endif
31-
3228
#include "firebird.h"
3329

3430
#include "../../common/classes/locks.h"

src/common/os/win32/guid.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,12 @@
2626
*
2727
*/
2828

29-
#ifndef __MINGW32__
30-
// minimum win32 version: win98 / winnt4 SP3
31-
#define _WIN32_WINNT 0x0403
32-
#endif
33-
29+
#include "firebird.h"
3430
#include <windows.h>
3531
#include <bcrypt.h>
3632
#include <objbase.h>
3733
#include <stdio.h>
3834

39-
#include "firebird.h"
4035
#include "../common/os/guid.h"
4136
#include "fb_exception.h"
4237

src/common/os/win32/mod_loader.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
*
44
*/
55

6-
// required to use activation context API structures
7-
#define _WIN32_WINNT 0x0501
8-
96
#include "firebird.h"
107
#include "../../../common/dllinst.h"
118
#include "../common/os/mod_loader.h"

src/common/sha.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef SHA_H
1010
#define SHA_H
1111

12+
#include "firebird.h"
1213
#include <stdlib.h>
1314
#include <stdio.h>
1415
#include "../common/sha.h"
@@ -31,8 +32,6 @@ void sha_final(unsigned char [SHA_DIGESTSIZE], SHA_INFO *) noexcept;
3132

3233
#define SHA_VERSION 1
3334

34-
#include "firebird.h"
35-
3635
#ifdef WORDS_BIGENDIAN
3736
# if SIZEOF_LONG == 4
3837
# define SHA_BYTE_ORDER 4321

src/common/sha2/sha2.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@
4949
#ifndef _SHA2_H
5050
#define _SHA2_H
5151

52-
#include <string.h>
5352
#ifndef NIST_COMPLIANCY_TESTS
5453
#include "firebird.h"
54+
#endif
55+
56+
#include <string.h>
57+
58+
#ifndef NIST_COMPLIANCY_TESTS
5559
#include "../../common/classes/alloc.h"
5660
#include "../../common/classes/array.h"
5761
#include "../../common/classes/fb_string.h"

src/dsql/StmtNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
* Adriano dos Santos Fernandes - refactored from pass1.cpp, gen.cpp, cmp.cpp, par.cpp and exe.cpp
1919
*/
2020

21-
#include <algorithm>
2221
#include "firebird.h"
22+
#include <algorithm>
2323
#include "firebird/impl/blr.h"
2424
#include "../common/TimeZoneUtil.h"
2525
#include "../common/classes/BaseStream.h"

src/extlib/ib_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
* Adriano dos Santos Fernandes
1919
*/
2020

21-
#include <stdlib.h>
2221
#include "firebird.h"
22+
#include <stdlib.h>
2323
#include "ibase.h"
2424

2525

0 commit comments

Comments
 (0)