Skip to content

Explicitly default the expected Windows API to 0x0601 (Windows 7) #8680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ if (MINGW)
set(CMAKE_SHARED_MODULE_PREFIX)
set(CMAKE_STATIC_LIBRARY_PREFIX)

add_definitions(-D_WIN32_WINNT=0x0600)
# 0x0601 is Windows 7 - see also comments in autoconfig_msvc.h
add_definitions(-D_WIN32_WINNT=0x0601)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4 -std=c++20")
endif()

Expand Down
2 changes: 1 addition & 1 deletion builds/win32/msvc15/FirebirdCommon.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<CompileAs>Default</CompileAs>
<UseFullPaths>false</UseFullPaths>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatSpecificWarningsAsErrors>4715</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
Expand Down
48 changes: 24 additions & 24 deletions extern/libcds/projects/Win/vc141/cds.vcxproj

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/common/classes/fb_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
#ifndef INCLUDE_FB_STRING_H
#define INCLUDE_FB_STRING_H

#include "firebird.h"

#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <utility>

#include "firebird.h"
#include "fb_types.h"
#include "fb_exception.h"
#include "../common/classes/alloc.h"
Expand Down
4 changes: 0 additions & 4 deletions src/common/classes/locks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
* Contributor(s): ______________________________________.
*/

#ifndef __MINGW32__
#define _WIN32_WINNT 0x0403
#endif

#include "firebird.h"

#include "../../common/classes/locks.h"
Expand Down
7 changes: 1 addition & 6 deletions src/common/os/win32/guid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,12 @@
*
*/

#ifndef __MINGW32__
// minimum win32 version: win98 / winnt4 SP3
#define _WIN32_WINNT 0x0403
#endif

#include "firebird.h"
#include <windows.h>
#include <bcrypt.h>
#include <objbase.h>
#include <stdio.h>

#include "firebird.h"
#include "../common/os/guid.h"
#include "fb_exception.h"

Expand Down
3 changes: 0 additions & 3 deletions src/common/os/win32/mod_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
*
*/

// required to use activation context API structures
#define _WIN32_WINNT 0x0501

#include "firebird.h"
#include "../../../common/dllinst.h"
#include "../common/os/mod_loader.h"
Expand Down
3 changes: 1 addition & 2 deletions src/common/sha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef SHA_H
#define SHA_H

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

#define SHA_VERSION 1

#include "firebird.h"

#ifdef WORDS_BIGENDIAN
# if SIZEOF_LONG == 4
# define SHA_BYTE_ORDER 4321
Expand Down
6 changes: 5 additions & 1 deletion src/common/sha2/sha2.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@
#ifndef _SHA2_H
#define _SHA2_H

#include <string.h>
#ifndef NIST_COMPLIANCY_TESTS
#include "firebird.h"
#endif

#include <string.h>

#ifndef NIST_COMPLIANCY_TESTS
#include "../../common/classes/alloc.h"
#include "../../common/classes/array.h"
#include "../../common/classes/fb_string.h"
Expand Down
2 changes: 1 addition & 1 deletion src/dsql/StmtNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* Adriano dos Santos Fernandes - refactored from pass1.cpp, gen.cpp, cmp.cpp, par.cpp and exe.cpp
*/

#include <algorithm>
#include "firebird.h"
#include <algorithm>
#include "firebird/impl/blr.h"
#include "../common/TimeZoneUtil.h"
#include "../common/classes/BaseStream.h"
Expand Down
2 changes: 1 addition & 1 deletion src/extlib/ib_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* Adriano dos Santos Fernandes
*/

#include <stdlib.h>
#include "firebird.h"
#include <stdlib.h>
#include "ibase.h"


Expand Down
36 changes: 14 additions & 22 deletions src/include/gen/autoconfig_msvc.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
/*
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports:
* - MAC (MAC, MAC_AUX and "MAC_CP" defines)
* - EPSON, DELTA, IMP, NCR3000, NeXT, M88K, Cray
* - OS/2, Apollo
*
* 2002-02-23 Sean Leyne - Code Cleanup, removed old Win3.1 port (Windows_Only)
*
* 2002.10.27 Sean Leyne - Code Cleanup, removed obsolete "UNIXWARE" port
* 2002.10.27 Sean Leyne - Code Cleanup, removed obsolete "Ultrix" port
*
* 2002.10.28 Sean Leyne - Completed removal of obsolete "DGUX" port
* 2002.10.28 Sean Leyne - Code cleanup, removed obsolete "MPEXL" port
* 2002.10.28 Sean Leyne - Code cleanup, removed obsolete "SGI" port
*
* 2002.10.29 Sean Leyne - Removed obsolete "Netware" port
*
* 2002.10.30 Sean Leyne - Removed support for obsolete "PC_PLATFORM" define
*
*/

#ifndef AUTOCONFIG_H
#define AUTOCONFIG_H

// Windows 7 (0x0601) is the baseline version for Firebird 6.
// NOTE: This does not mean that this version is supported, but that we want to limit Windows API
// use to this version.
#define FB_WIN32_WINNT_BASELINE 0x0601

// Normally, _WIN32_WINNT is defined in the PreprocessorDefinitions of Firebird.Common.props.
#ifndef _WIN32_WINNT
// Fallback to set _WIN32_WINNT to the baseline.
#define _WIN32_WINNT FB_WIN32_WINNT_BASELINE
#elif (_WIN32_WINNT < FB_WIN32_WINNT_BASELINE)
// Consider Windows versions before the baseline really too old.
#error The target Windows version (_WIN32_WINNT) is too old
#endif

//#pragma warning(disable:4099) // class/struct mixups
#pragma warning(disable:4251) // needs to have dll-interface
#pragma warning(disable:4291) // no matching op. delete (there are)
Expand Down Expand Up @@ -68,7 +61,6 @@

#pragma warning(disable:4996) // 'identificator' was declared deprecated


#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

#ifdef _MSC_VER // don't know if this is useful for MinGW
Expand Down
Loading