diff options
author | George Hazan <ghazan@miranda.im> | 2020-03-02 13:20:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-03-02 13:20:17 +0300 |
commit | 4c9c071567afd9e759a92a3fbaf7bcca623c1822 (patch) | |
tree | f7d420c64ce2d4cc8bd07dd0aaf8ae691a9fa6e5 /tools/mdbx_load/src/stdafx.h | |
parent | a31095992ac06db3900aad856d7ace3786df7cdd (diff) |
mdbx utilities:
- fixes #2239 (-a parameter is missing in fixme.cmd);
- merge of recent changes in mdbx utilities;
- crutch for Windows to print dynamically exported data
Diffstat (limited to 'tools/mdbx_load/src/stdafx.h')
-rw-r--r-- | tools/mdbx_load/src/stdafx.h | 61 |
1 files changed, 8 insertions, 53 deletions
diff --git a/tools/mdbx_load/src/stdafx.h b/tools/mdbx_load/src/stdafx.h index c54474f43b..518027200a 100644 --- a/tools/mdbx_load/src/stdafx.h +++ b/tools/mdbx_load/src/stdafx.h @@ -21,56 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdint.h> #include <windows.h> -#define MDBX_TOOLS /* Avoid using internal mdbx_assert() */ -#include "../../libs/libmdbx/src/src/elements/internals.h" - -#define CMP_UINT(x, y) { if ((x) != (y)) return (x) < (y) ? -1 : 1; } - -struct DBEventSortingKey -{ - uint32_t hContact; - uint32_t hEvent; - uint64_t ts; - - static int Compare(const MDBX_val *ax, const MDBX_val *bx) - { - const DBEventSortingKey *a = (DBEventSortingKey*)ax->iov_base; - const DBEventSortingKey *b = (DBEventSortingKey*)bx->iov_base; - - CMP_UINT(a->hContact, b->hContact); - CMP_UINT(a->ts, b->ts); - CMP_UINT(a->hEvent, b->hEvent); - return 0; - } -}; - -struct DBEventIdKey -{ - uint32_t iModuleId; // offset to a DBModuleName struct of the name of - char szEventId[256]; // string id - - static int Compare(const MDBX_val *ax, const MDBX_val *bx) - { - const DBEventIdKey *a = (DBEventIdKey*)ax->iov_base; - const DBEventIdKey *b = (DBEventIdKey*)bx->iov_base; - CMP_UINT(a->iModuleId, b->iModuleId); - return strcmp(a->szEventId, b->szEventId); - } -}; - -struct DBSettingKey -{ - uint32_t hContact; - uint32_t dwModuleId; - char szSettingName[1]; - - static int Compare(const MDBX_val *ax, const MDBX_val *bx) - { - const DBSettingKey *a = (DBSettingKey*)ax->iov_base; - const DBSettingKey *b = (DBSettingKey*)bx->iov_base; - - CMP_UINT(a->hContact, b->hContact); - CMP_UINT(a->dwModuleId, b->dwModuleId); - return strcmp(a->szSettingName, b->szSettingName); - } -}; +#define DECLARE_VERSION() \ + mdbx_version_info MDBX_version; \ + mdbx_build_info MDBX_build; \ + char* MDBX_sourcery_anchor; \ + HINSTANCE hDll = LoadLibraryA("libmdbx.mir"); \ + MDBX_version = *(mdbx_version_info *)GetProcAddress(hDll, "mdbx_version"); \ + MDBX_build = *(mdbx_build_info*)GetProcAddress(hDll, "mdbx_build"); \ + MDBX_sourcery_anchor = (char*)GetProcAddress(hDll, "mdbx_sourcery_MDBX_BUILD_SOURCERY"); |