diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e2a4a79..e0b9cb8c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,7 +37,9 @@ endif()
set(USE_PCH FALSE CACHE BOOL "Use shared precompiled headers for MSVC")
-include_directories(src contrib/eos_portable_archive contrib/db/liblmdb contrib contrib/epee/include "${CMAKE_BINARY_DIR}/version" "${CMAKE_BINARY_DIR}/contrib/zlib")
+#include_directories(src contrib/eos_portable_archive contrib/db/liblmdb contrib contrib/epee/include "${CMAKE_BINARY_DIR}/version" "${CMAKE_BINARY_DIR}/contrib/zlib")
+include_directories(src contrib/eos_portable_archive contrib/db/libmdbx contrib contrib/epee/include "${CMAKE_BINARY_DIR}/version" "${CMAKE_BINARY_DIR}/contrib/zlib")
+
add_definitions(-DSTATICLIB)
set(TESTNET FALSE CACHE BOOL "Compile for testnet")
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index c1ea6bdd..7acb5249 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -9,7 +9,8 @@ add_subdirectory(ethereum)
set_property(TARGET upnpc-static PROPERTY FOLDER "contrib/miniupnp")
set_property(TARGET zlibstatic PROPERTY FOLDER "contrib")
-set_property(TARGET lmdb PROPERTY FOLDER "contrib")
+# set_property(TARGET lmdb PROPERTY FOLDER "contrib")
+set_property(TARGET mdbx PROPERTY FOLDER "contrib")
diff --git a/contrib/db/CMakeLists.txt b/contrib/db/CMakeLists.txt
index eb5c8415..3ff49da1 100644
--- a/contrib/db/CMakeLists.txt
+++ b/contrib/db/CMakeLists.txt
@@ -1,7 +1,8 @@
-add_subdirectory(liblmdb)
+# add_subdirectory(liblmdb)
+add_subdirectory(libmdbx)
if(MSVC)
- target_compile_options(lmdb PRIVATE /wd4996 /wd4503 /wd4345 /wd4267 /wd4244 /wd4146 /wd4333 /wd4172)
+ # target_compile_options(lmdb PRIVATE /wd4996 /wd4503 /wd4345 /wd4267 /wd4244 /wd4146 /wd4333 /wd4172)
else()
# Warnings as used by LMDB itself (LMDB_0.9.23)
- target_compile_options(lmdb PRIVATE -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized)
+ # target_compile_options(lmdb PRIVATE -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized)
endif()
diff --git a/contrib/db/libmdbx/dll.vcxproj b/contrib/db/libmdbx/dll.vcxproj
deleted file mode 100644
index 5464c158..00000000
--- a/contrib/db/libmdbx/dll.vcxproj
+++ /dev/null
@@ -1,223 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}
- Win32Proj
- 8.1
-
-
-
- DynamicLibrary
- true
- v140
- MultiByte
-
-
- DynamicLibrary
- false
- v140
- true
- MultiByte
-
-
- DynamicLibrary
- true
- v140
- MultiByte
-
-
- DynamicLibrary
- false
- v140
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- mdbx
- $(SolutionDir)$(Platform)\$(Configuration)\
- $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\
- PreLinkEvent
-
-
- false
- $(SolutionDir)$(Platform)\$(Configuration)\
- mdbx
- $(SolutionDir)$(Platform)\$(Configuration)\
- $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\
- PreLinkEvent
-
-
- true
- mdbx
- $(SolutionDir)$(Platform)\$(Configuration)\
- $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\
- PreLinkEvent
-
-
- false
- mdbx
- $(SolutionDir)$(Platform)\$(Configuration)\
- $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\
- PreLinkEvent
-
-
-
- WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBMDBX_EXPORTS;MDBX_BUILD_DLL;MDBX_AVOID_CRT;%(PreprocessorDefinitions)
- MultiThreadedDebugDLL
- EnableAllWarnings
- ProgramDatabase
- Disabled
- true
- true
-
-
- MachineX86
- true
- Windows
- ntdll.lib;$(IntermediateOutputPath)mdbx_ntdll_extra.lib;kernel32.lib;advapi32.lib;%(AdditionalDependencies)
-
-
- Generate fake-library mdbx_ntdll_extra.lib for $(PlatformTarget)
- $(IntermediateOutputPath)mdbx_ntdll_extra.lib
- $(ProjectDir)src/ntdll.def
- lib.exe /def:%(Inputs) /out:%(Outputs) /machine:$(PlatformTarget)
-
-
-
-
- WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBMDBX_EXPORTS;MDBX_BUILD_DLL;MDBX_AVOID_CRT;%(PreprocessorDefinitions)
- MultiThreadedDLL
- EnableAllWarnings
- ProgramDatabase
- true
- Full
- AnySuitable
- true
- Size
- true
- true
- true
- false
- All
-
-
- MachineX86
- true
- Windows
- true
- true
- UseLinkTimeCodeGeneration
- ntdll.lib;$(IntermediateOutputPath)mdbx_ntdll_extra.lib;kernel32.lib;advapi32.lib;%(AdditionalDependencies)
- true
-
-
- Generate fake-library mdbx_ntdll_extra.lib for $(PlatformTarget)
- $(IntermediateOutputPath)mdbx_ntdll_extra.lib
- $(ProjectDir)src/ntdll.def
- lib.exe /def:%(Inputs) /out:%(Outputs) /machine:$(PlatformTarget)
-
-
-
-
- ProgramDatabase
-
-
-
-
- EnableAllWarnings
- WIN64;_DEBUG;_WINDOWS;_USRDLL;LIBMDBX_EXPORTS;MDBX_BUILD_DLL;MDBX_AVOID_CRT;%(PreprocessorDefinitions)
- MultiThreadedDebugDLL
- true
- true
-
-
- ntdll.lib;$(IntermediateOutputPath)mdbx_ntdll_extra.lib;kernel32.lib;advapi32.lib;%(AdditionalDependencies)
-
-
- Generate fake-library mdbx_ntdll_extra.lib for $(PlatformTarget)
- $(IntermediateOutputPath)mdbx_ntdll_extra.lib
- $(ProjectDir)src/ntdll.def
- lib.exe /def:%(Inputs) /out:%(Outputs) /machine:$(PlatformTarget)
-
-
-
-
- WIN64;NDEBUG;_WINDOWS;_USRDLL;LIBMDBX_EXPORTS;MDBX_BUILD_DLL;MDBX_AVOID_CRT;%(PreprocessorDefinitions)
- MultiThreadedDLL
- true
- Full
- AnySuitable
- true
- Size
- true
- true
- EnableAllWarnings
- true
- false
- All
-
-
- UseLinkTimeCodeGeneration
- ntdll.lib;$(IntermediateOutputPath)mdbx_ntdll_extra.lib;kernel32.lib;advapi32.lib;%(AdditionalDependencies)
- true
-
-
- Generate fake-library mdbx_ntdll_extra.lib for $(PlatformTarget)
- $(IntermediateOutputPath)mdbx_ntdll_extra.lib
- $(ProjectDir)src/ntdll.def
- lib.exe /def:%(Inputs) /out:%(Outputs) /machine:$(PlatformTarget)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/contrib/db/libmdbx/mdbx.sln b/contrib/db/libmdbx/mdbx.sln
deleted file mode 100644
index f1462ab8..00000000
--- a/contrib/db/libmdbx/mdbx.sln
+++ /dev/null
@@ -1,97 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcxproj", "{30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll", "dll.vcxproj", "{6D19209B-ECE7-4B9C-941C-0AA2B484F199}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{0A147F9F-22D5-44E6-B389-218CFFB0C524}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdbx_load", "src\tools\mdbx_load.vcxproj", "{15030120-5F7F-48F9-ABE5-DFC814F2A4BB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdbx_dump", "src\tools\mdbx_dump.vcxproj", "{15030120-5F7F-48F9-ABE5-DFC814F2A4BC}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdbx_copy", "src\tools\mdbx_copy.vcxproj", "{15030120-5F7F-48F9-ABE5-DFC814F2A4BD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdbx_chk", "src\tools\mdbx_chk.vcxproj", "{15030120-5F7F-48F9-ABE5-DFC814F2A4BE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdbx_stat", "src\tools\mdbx_stat.vcxproj", "{15030120-5F7F-48F9-ABE5-DFC814F2A4BF}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}.Debug|x64.ActiveCfg = Debug|x64
- {30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}.Debug|x64.Build.0 = Debug|x64
- {30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}.Debug|x86.ActiveCfg = Debug|Win32
- {30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}.Debug|x86.Build.0 = Debug|Win32
- {30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}.Release|x64.ActiveCfg = Release|x64
- {30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}.Release|x64.Build.0 = Release|x64
- {30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}.Release|x86.ActiveCfg = Release|Win32
- {30E29CE6-E6FC-4D32-AA07-46A55FAF3A31}.Release|x86.Build.0 = Release|Win32
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}.Debug|x64.ActiveCfg = Debug|x64
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}.Debug|x64.Build.0 = Debug|x64
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}.Debug|x86.ActiveCfg = Debug|Win32
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}.Debug|x86.Build.0 = Debug|Win32
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}.Release|x64.ActiveCfg = Release|x64
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}.Release|x64.Build.0 = Release|x64
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}.Release|x86.ActiveCfg = Release|Win32
- {6D19209B-ECE7-4B9C-941C-0AA2B484F199}.Release|x86.Build.0 = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB}.Debug|x64.ActiveCfg = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB}.Debug|x64.Build.0 = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB}.Debug|x86.ActiveCfg = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB}.Debug|x86.Build.0 = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB}.Release|x64.ActiveCfg = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB}.Release|x64.Build.0 = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB}.Release|x86.ActiveCfg = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB}.Release|x86.Build.0 = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC}.Debug|x64.ActiveCfg = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC}.Debug|x64.Build.0 = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC}.Debug|x86.ActiveCfg = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC}.Debug|x86.Build.0 = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC}.Release|x64.ActiveCfg = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC}.Release|x64.Build.0 = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC}.Release|x86.ActiveCfg = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC}.Release|x86.Build.0 = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD}.Debug|x64.ActiveCfg = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD}.Debug|x64.Build.0 = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD}.Debug|x86.ActiveCfg = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD}.Debug|x86.Build.0 = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD}.Release|x64.ActiveCfg = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD}.Release|x64.Build.0 = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD}.Release|x86.ActiveCfg = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD}.Release|x86.Build.0 = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE}.Debug|x64.ActiveCfg = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE}.Debug|x64.Build.0 = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE}.Debug|x86.ActiveCfg = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE}.Debug|x86.Build.0 = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE}.Release|x64.ActiveCfg = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE}.Release|x64.Build.0 = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE}.Release|x86.ActiveCfg = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE}.Release|x86.Build.0 = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF}.Debug|x64.ActiveCfg = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF}.Debug|x64.Build.0 = Debug|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF}.Debug|x86.ActiveCfg = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF}.Debug|x86.Build.0 = Debug|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF}.Release|x64.ActiveCfg = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF}.Release|x64.Build.0 = Release|x64
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF}.Release|x86.ActiveCfg = Release|Win32
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF}.Release|x86.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BB} = {0A147F9F-22D5-44E6-B389-218CFFB0C524}
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BC} = {0A147F9F-22D5-44E6-B389-218CFFB0C524}
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BD} = {0A147F9F-22D5-44E6-B389-218CFFB0C524}
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BE} = {0A147F9F-22D5-44E6-B389-218CFFB0C524}
- {15030120-5F7F-48F9-ABE5-DFC814F2A4BF} = {0A147F9F-22D5-44E6-B389-218CFFB0C524}
- EndGlobalSection
-EndGlobal
diff --git a/contrib/db/libmdbx/src/osal.c b/contrib/db/libmdbx/src/osal.c
index 993d83b0..48d6d4e2 100644
--- a/contrib/db/libmdbx/src/osal.c
+++ b/contrib/db/libmdbx/src/osal.c
@@ -18,6 +18,8 @@
#if defined(_WIN32) || defined(_WIN64)
+#include
+
static int waitstatus2errcode(DWORD result) {
switch (result) {
case WAIT_OBJECT_0:
diff --git a/contrib/db/libmdbx/src/osal.h b/contrib/db/libmdbx/src/osal.h
index b690a5a5..dba9f798 100644
--- a/contrib/db/libmdbx/src/osal.h
+++ b/contrib/db/libmdbx/src/osal.h
@@ -753,7 +753,7 @@ typedef NTSTATUS(NTAPI *MDBX_NtFsControlFile)(
OUT OPTIONAL PVOID OutputBuffer, IN ULONG OutputBufferLength);
extern MDBX_NtFsControlFile mdbx_NtFsControlFile;
-#ifndef _WIN32_WINNT_WIN8
+#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
typedef struct _WIN32_MEMORY_RANGE_ENTRY {
PVOID VirtualAddress;
SIZE_T NumberOfBytes;
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d6f96312..fa8a230c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -116,7 +116,7 @@ add_library(wallet ${WALLET})
add_dependencies(wallet version ${PCH_LIB_NAME})
ENABLE_SHARED_PCH(WALLET)
-target_link_libraries(currency_core lmdb)
+target_link_libraries(currency_core mdbx)
add_executable(daemon ${DAEMON} ${P2P} ${CURRENCY_PROTOCOL})
add_dependencies(daemon version)