2010-09-20 22:08:53 +02:00
|
|
|
/* src/include/port/win32.h */
|
2006-10-03 05:59:22 +02:00
|
|
|
|
2017-11-16 16:36:18 +01:00
|
|
|
/*
|
|
|
|
* We always rely on the WIN32 macro being set by our build system,
|
|
|
|
* but _WIN32 is the compiler pre-defined macro. So make sure we define
|
|
|
|
* WIN32 whenever _WIN32 is set, to facilitate standalone building.
|
|
|
|
*/
|
|
|
|
#if defined(_WIN32) && !defined(WIN32)
|
|
|
|
#define WIN32
|
|
|
|
#endif
|
|
|
|
|
2011-01-31 01:56:46 +01:00
|
|
|
/*
|
2012-04-24 04:43:09 +02:00
|
|
|
* Make sure _WIN32_WINNT has the minimum required value.
|
Make Windows 10 the minimal runtime requirement for WIN32
This commit bumps the runtime value of _WIN32_WINNT to be 0x0A00 for any
builds on Windows. Hence, this makes Windows 10 the minimal requirement
when running PostgreSQL under WIN32, be it for builds of Cygwin, MinGW
or Visual Studio.
The previous minimal runtime version was either Windows Vista when
building with at least Visual Studio 2015 or Windows XP for the rest.
Windows 10 is the most modern version supported by Microsoft, and per
discussion, as we don't have buildfarm members that run older versions
anymore, this is the minimal supported version that suits better for our
needs. This will actually make easier the development of some patches,
two being async I/O and large page handling by avoiding a lot of
compatibility gotchas, on platforms that have most likely few users
anyway.
It is possible to remove MIN_WINNT in win32.h and the macros
IsWindowsXXXOrGreater() that were used in the code at runtime to check
which version of Windows was getting used. The change in pg_locale.c
comes from Juan. Note that all my tests passed, and that the CI is
green. The buildfarm will quickly tell if this needs more adjustments.
Author: Michael Paquier, Juan José Santamaría Flecha
Reviewed-by: Thomas Munro
Discussion: https://postgr.es/m/Yo7tHKD8VCkeNi71@paquier.xyz
2022-07-07 06:25:45 +02:00
|
|
|
* Leave a higher value in place. The minimum requirement is Windows 10.
|
2016-04-29 13:59:47 +02:00
|
|
|
*/
|
Make Windows 10 the minimal runtime requirement for WIN32
This commit bumps the runtime value of _WIN32_WINNT to be 0x0A00 for any
builds on Windows. Hence, this makes Windows 10 the minimal requirement
when running PostgreSQL under WIN32, be it for builds of Cygwin, MinGW
or Visual Studio.
The previous minimal runtime version was either Windows Vista when
building with at least Visual Studio 2015 or Windows XP for the rest.
Windows 10 is the most modern version supported by Microsoft, and per
discussion, as we don't have buildfarm members that run older versions
anymore, this is the minimal supported version that suits better for our
needs. This will actually make easier the development of some patches,
two being async I/O and large page handling by avoiding a lot of
compatibility gotchas, on platforms that have most likely few users
anyway.
It is possible to remove MIN_WINNT in win32.h and the macros
IsWindowsXXXOrGreater() that were used in the code at runtime to check
which version of Windows was getting used. The change in pg_locale.c
comes from Juan. Note that all my tests passed, and that the CI is
green. The buildfarm will quickly tell if this needs more adjustments.
Author: Michael Paquier, Juan José Santamaría Flecha
Reviewed-by: Thomas Munro
Discussion: https://postgr.es/m/Yo7tHKD8VCkeNi71@paquier.xyz
2022-07-07 06:25:45 +02:00
|
|
|
#ifdef _WIN32_WINNT
|
2011-01-31 02:34:05 +01:00
|
|
|
#undef _WIN32_WINNT
|
2011-01-31 01:56:46 +01:00
|
|
|
#endif
|
2016-04-29 13:59:47 +02:00
|
|
|
|
Make Windows 10 the minimal runtime requirement for WIN32
This commit bumps the runtime value of _WIN32_WINNT to be 0x0A00 for any
builds on Windows. Hence, this makes Windows 10 the minimal requirement
when running PostgreSQL under WIN32, be it for builds of Cygwin, MinGW
or Visual Studio.
The previous minimal runtime version was either Windows Vista when
building with at least Visual Studio 2015 or Windows XP for the rest.
Windows 10 is the most modern version supported by Microsoft, and per
discussion, as we don't have buildfarm members that run older versions
anymore, this is the minimal supported version that suits better for our
needs. This will actually make easier the development of some patches,
two being async I/O and large page handling by avoiding a lot of
compatibility gotchas, on platforms that have most likely few users
anyway.
It is possible to remove MIN_WINNT in win32.h and the macros
IsWindowsXXXOrGreater() that were used in the code at runtime to check
which version of Windows was getting used. The change in pg_locale.c
comes from Juan. Note that all my tests passed, and that the CI is
green. The buildfarm will quickly tell if this needs more adjustments.
Author: Michael Paquier, Juan José Santamaría Flecha
Reviewed-by: Thomas Munro
Discussion: https://postgr.es/m/Yo7tHKD8VCkeNi71@paquier.xyz
2022-07-07 06:25:45 +02:00
|
|
|
#define _WIN32_WINNT 0x0A00
|
2016-04-29 13:59:47 +02:00
|
|
|
|
2007-07-24 11:00:27 +02:00
|
|
|
/*
|
2017-11-16 16:36:18 +01:00
|
|
|
* We need to prevent <crtdefs.h> from defining a symbol conflicting with
|
|
|
|
* our errcode() function. Since it's likely to get included by standard
|
|
|
|
* system headers, pre-emptively include it now.
|
2007-07-24 11:00:27 +02:00
|
|
|
*/
|
2019-10-08 10:27:30 +02:00
|
|
|
#if defined(_MSC_VER) || defined(HAVE_CRTDEFS_H)
|
2017-11-16 16:36:18 +01:00
|
|
|
#define errcode __msvc_errcode
|
|
|
|
#include <crtdefs.h>
|
|
|
|
#undef errcode
|
2011-01-31 01:56:46 +01:00
|
|
|
#endif
|
2010-12-09 02:01:09 +01:00
|
|
|
|
2005-06-16 19:53:54 +02:00
|
|
|
/*
|
2017-11-16 16:36:18 +01:00
|
|
|
* defines for dynamic linking on Win32 platform
|
2012-11-07 21:01:18 +01:00
|
|
|
*/
|
2013-05-29 22:58:43 +02:00
|
|
|
|
2021-11-29 17:00:00 +01:00
|
|
|
/*
|
|
|
|
* Variables declared in the core backend and referenced by loadable
|
|
|
|
* modules need to be marked "dllimport" in the core build, but
|
|
|
|
* "dllexport" when the declaration is read in a loadable module.
|
|
|
|
* No special markings should be used when compiling frontend code.
|
|
|
|
*/
|
|
|
|
#ifndef FRONTEND
|
2002-01-22 20:02:40 +01:00
|
|
|
#ifdef BUILDING_DLL
|
2007-07-25 14:22:54 +02:00
|
|
|
#define PGDLLIMPORT __declspec (dllexport)
|
2017-11-16 16:36:18 +01:00
|
|
|
#else
|
2007-07-25 14:22:54 +02:00
|
|
|
#define PGDLLIMPORT __declspec (dllimport)
|
2002-01-22 20:02:40 +01:00
|
|
|
#endif
|
2021-11-29 17:00:00 +01:00
|
|
|
#endif
|
2002-01-22 20:02:40 +01:00
|
|
|
|
2021-11-29 17:00:00 +01:00
|
|
|
/*
|
|
|
|
* Under MSVC, functions exported by a loadable module must be marked
|
|
|
|
* "dllexport". Other compilers don't need that.
|
|
|
|
*/
|
2010-05-28 18:34:15 +02:00
|
|
|
#ifdef _MSC_VER
|
2010-05-27 09:59:48 +02:00
|
|
|
#define PGDLLEXPORT __declspec (dllexport)
|
2010-05-28 18:34:15 +02:00
|
|
|
#endif
|