mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:04:12 +08:00
mdbx-windows: fix build for Windows XP/2000 (_WIN32_WINNT
< 0x0600).
Related to https://github.com/erthink/libmdbx/issues/155 Change-Id: Ibd795817e05b6da39ef270ce7b55b31d963d07b0
This commit is contained in:
parent
8e078fb708
commit
ab1fc94a5b
2
.github/actions/spelling/expect.txt
vendored
2
.github/actions/spelling/expect.txt
vendored
@ -832,6 +832,7 @@ LMEM
|
|||||||
LNK
|
LNK
|
||||||
lnps
|
lnps
|
||||||
lntdll
|
lntdll
|
||||||
|
LOBYTE
|
||||||
localtime
|
localtime
|
||||||
lockf
|
lockf
|
||||||
lockfile
|
lockfile
|
||||||
@ -844,6 +845,7 @@ longlived
|
|||||||
LONGLONG
|
LONGLONG
|
||||||
lowerbound
|
lowerbound
|
||||||
lowerboundvalue
|
lowerboundvalue
|
||||||
|
LOWORD
|
||||||
LPCSTR
|
LPCSTR
|
||||||
LPDWORD
|
LPDWORD
|
||||||
LPFILETIME
|
LPFILETIME
|
||||||
|
@ -216,6 +216,13 @@ template <> struct path_to_pchar<std::string> {
|
|||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
|
||||||
|
#ifndef WC_ERR_INVALID_CHARS
|
||||||
|
static const DWORD WC_ERR_INVALID_CHARS =
|
||||||
|
(6 /* Windows Vista */ <= /* MajorVersion */ LOBYTE(LOWORD(GetVersion())))
|
||||||
|
? 0x00000080
|
||||||
|
: 0;
|
||||||
|
#endif /* WC_ERR_INVALID_CHARS */
|
||||||
|
|
||||||
template <> struct path_to_pchar<std::wstring> {
|
template <> struct path_to_pchar<std::wstring> {
|
||||||
std::string str;
|
std::string str;
|
||||||
path_to_pchar(const std::wstring &path) {
|
path_to_pchar(const std::wstring &path) {
|
||||||
|
@ -133,6 +133,10 @@ typedef struct _FILE_PROVIDER_EXTERNAL_INFO_V1 {
|
|||||||
CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 196, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 196, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ERROR_NOT_CAPABLE
|
||||||
|
#define ERROR_NOT_CAPABLE 775L
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _WIN32 || _WIN64 */
|
#endif /* _WIN32 || _WIN64 */
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
48
src/osal.h
48
src/osal.h
@ -145,7 +145,7 @@ __extern_C key_t ftok(const char *, int);
|
|||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif /* WIN32_LEAN_AND_MEAN */
|
||||||
#include <excpt.h>
|
#include <excpt.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -837,6 +837,52 @@ MDBX_INTERNAL_VAR MDBX_srwlock_function mdbx_srwlock_Init,
|
|||||||
mdbx_srwlock_AcquireShared, mdbx_srwlock_ReleaseShared,
|
mdbx_srwlock_AcquireShared, mdbx_srwlock_ReleaseShared,
|
||||||
mdbx_srwlock_AcquireExclusive, mdbx_srwlock_ReleaseExclusive;
|
mdbx_srwlock_AcquireExclusive, mdbx_srwlock_ReleaseExclusive;
|
||||||
|
|
||||||
|
#if _WIN32_WINNT < 0x0600 /* prior to Windows Vista */
|
||||||
|
typedef enum _FILE_INFO_BY_HANDLE_CLASS {
|
||||||
|
FileBasicInfo,
|
||||||
|
FileStandardInfo,
|
||||||
|
FileNameInfo,
|
||||||
|
FileRenameInfo,
|
||||||
|
FileDispositionInfo,
|
||||||
|
FileAllocationInfo,
|
||||||
|
FileEndOfFileInfo,
|
||||||
|
FileStreamInfo,
|
||||||
|
FileCompressionInfo,
|
||||||
|
FileAttributeTagInfo,
|
||||||
|
FileIdBothDirectoryInfo,
|
||||||
|
FileIdBothDirectoryRestartInfo,
|
||||||
|
FileIoPriorityHintInfo,
|
||||||
|
FileRemoteProtocolInfo,
|
||||||
|
MaximumFileInfoByHandleClass
|
||||||
|
} FILE_INFO_BY_HANDLE_CLASS,
|
||||||
|
*PFILE_INFO_BY_HANDLE_CLASS;
|
||||||
|
|
||||||
|
typedef struct _FILE_END_OF_FILE_INFO {
|
||||||
|
LARGE_INTEGER EndOfFile;
|
||||||
|
} FILE_END_OF_FILE_INFO, *PFILE_END_OF_FILE_INFO;
|
||||||
|
|
||||||
|
#define REMOTE_PROTOCOL_INFO_FLAG_LOOPBACK 0x00000001
|
||||||
|
#define REMOTE_PROTOCOL_INFO_FLAG_OFFLINE 0x00000002
|
||||||
|
|
||||||
|
typedef struct _FILE_REMOTE_PROTOCOL_INFO {
|
||||||
|
USHORT StructureVersion;
|
||||||
|
USHORT StructureSize;
|
||||||
|
DWORD Protocol;
|
||||||
|
USHORT ProtocolMajorVersion;
|
||||||
|
USHORT ProtocolMinorVersion;
|
||||||
|
USHORT ProtocolRevision;
|
||||||
|
USHORT Reserved;
|
||||||
|
DWORD Flags;
|
||||||
|
struct {
|
||||||
|
DWORD Reserved[8];
|
||||||
|
} GenericReserved;
|
||||||
|
struct {
|
||||||
|
DWORD Reserved[16];
|
||||||
|
} ProtocolSpecificReserved;
|
||||||
|
} FILE_REMOTE_PROTOCOL_INFO, *PFILE_REMOTE_PROTOCOL_INFO;
|
||||||
|
|
||||||
|
#endif /* _WIN32_WINNT < 0x0600 (prior to Windows Vista) */
|
||||||
|
|
||||||
typedef BOOL(WINAPI *MDBX_GetFileInformationByHandleEx)(
|
typedef BOOL(WINAPI *MDBX_GetFileInformationByHandleEx)(
|
||||||
_In_ HANDLE hFile, _In_ FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
|
_In_ HANDLE hFile, _In_ FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
|
||||||
_Out_ LPVOID lpFileInformation, _In_ DWORD dwBufferSize);
|
_Out_ LPVOID lpFileInformation, _In_ DWORD dwBufferSize);
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64) || defined(_WINDOWS)
|
#if defined(_WIN32) || defined(_WIN64) || defined(_WINDOWS)
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT 0x0601 /* Windows 7 */
|
||||||
|
#endif
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
#pragma warning(push, 1)
|
#pragma warning(push, 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user