From 79f15dd0c72dd6899d84d9694195291e134a6e23 Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Fri, 17 Mar 2023 11:02:12 +0100 Subject: [PATCH] common: set Windows support as deprecated --- README.md | 20 ++ doc/README | 3 + doc/libpmem/libpmem.7.md | 4 + doc/libpmem2/libpmem2.7.md | 4 + doc/libpmemblk/libpmemblk.7.md | 4 + doc/libpmemlog/libpmemlog.7.md | 4 + doc/libpmemobj/libpmemobj.7.md | 4 + doc/libpmempool/libpmempool.7.md | 4 + doc/pmempool/pmempool.1.md | 4 + src/benchmarks/pmembench.vcxproj | 4 +- .../libpmemobj/tree_map/rtree_map.vcxproj | 2 +- src/include/libpmem.h | 71 +++++++- src/include/libpmem2/async.h | 8 + src/include/libpmem2/base.h | 172 +++++++++++++++++- src/include/libpmemblk.h | 42 +++-- src/include/libpmemlog.h | 34 ++-- src/include/libpmemobj/action_base.h | 26 ++- src/include/libpmemobj/atomic_base.h | 29 ++- src/include/libpmemobj/base.h | 69 ++++++- src/include/libpmemobj/ctl.h | 8 +- src/include/libpmemobj/iterator_base.h | 8 +- src/include/libpmemobj/lists_atomic_base.h | 14 +- src/include/libpmemobj/pool_base.h | 27 ++- src/include/libpmemobj/thread.h | 56 +++++- src/include/libpmemobj/tx_base.h | 98 +++++++++- src/include/libpmempool.h | 31 +++- src/test/log_recovery/log_recovery.vcxproj | 6 +- src/test/obj_action/obj_action.vcxproj | 6 +- src/test/obj_alloc/obj_alloc.vcxproj | 6 +- .../obj_basic_integration.vcxproj | 6 +- src/test/obj_critnib/obj_critnib.vcxproj | 3 +- .../obj_critnib_mt/obj_critnib_mt.vcxproj | 3 +- src/test/obj_direct/obj_direct.vcxproj | 6 +- .../obj_direct_volatile.vcxproj | 6 +- .../obj_heap_reopen/obj_heap_reopen.vcxproj | 6 +- src/test/obj_list/obj_list.vcxproj | 4 +- src/test/obj_realloc/obj_realloc.vcxproj | 4 +- src/test/obj_sync/obj_sync.vcxproj | 6 +- .../obj_tx_add_range/obj_tx_add_range.vcxproj | 4 +- .../obj_tx_add_range_direct.vcxproj | 4 +- src/test/obj_ulog_size/obj_ulog_size.vcxproj | 4 +- .../pmem_deep_persist.vcxproj | 3 +- .../pmem_has_auto_flush_win.vcxproj | 3 +- src/test/pmem_map_file/pmem_map_file.vcxproj | 3 +- .../pmem_map_file_trunc.vcxproj | 3 +- .../pmem_map_file_win.vcxproj | 3 +- src/test/signal_handle/signal_handle.vcxproj | 6 +- src/test/tools/pmemobjcli/pmemobjcli.vcxproj | 4 +- src/test/util_ctl/util_ctl.vcxproj | 3 +- src/tools/pmempool/check.h | 13 +- src/tools/pmempool/common.h | 105 +++++++++++ src/tools/pmempool/convert.h | 13 +- src/tools/pmempool/create.h | 13 +- src/tools/pmempool/dump.h | 13 +- src/tools/pmempool/feature.h | 13 +- src/tools/pmempool/info.h | 15 ++ src/tools/pmempool/output.h | 99 ++++++++++ src/tools/pmempool/rm.h | 13 +- src/tools/pmempool/synchronize.h | 13 +- src/tools/pmempool/transform.h | 13 +- src/windows/getopt/getopt.vcxproj | 2 +- 61 files changed, 1047 insertions(+), 130 deletions(-) diff --git a/README.md b/README.md index dca66414859..9b67d67dd0d 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,10 @@ Available Utilities: Currently these libraries only work on 64-bit Linux, Windows2, and 64-bit FreeBSD 11+3. For information on how these libraries are licensed, see our [LICENSE](LICENSE) file. +> NOTICE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + >1 Not supported on Windows. > >2 PMDK for Windows is feature complete, but not yet considered production quality. @@ -107,6 +111,10 @@ Additionally, we recommend reading [Introduction to Programming with Persistent ## Pre-Built Packages for Windows +> NOTICE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + The recommended and easiest way to install PMDK on Windows is to use Microsoft vcpkg. Vcpkg is an open source tool and ecosystem created for library management. To install the latest PMDK release and link it to your Visual Studio solution you first need to clone and set up vcpkg on your machine as described on the [vcpkg github page](https://github.com/Microsoft/vcpkg) in **Quick Start** section. @@ -159,6 +167,10 @@ see https://github.com/pmem/pmdk/issues/4207. ### Windows +> NOTICE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + * **MS Visual Studio 2022** * [Windows SDK 10.0.22000.0](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) * **Windows, version >= 1803** @@ -325,6 +337,10 @@ and UndefinedBehaviorSanitizer, run: ## Building PMDK on Windows +> NOTICE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + Clone the PMDK tree and open the solution: ``` > git clone https://github.com/pmem/pmdk @@ -337,6 +353,10 @@ Select the desired configuration (Debug or Release) and build the solution ### Testing Libraries on Windows +> NOTICE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + Before running the tests, you may need to prepare a test configuration file (src/test/testconfig.ps1). Please see the available configuration settings in the example file [src/test/testconfig.ps1.example](src/test/testconfig.ps1.example). To **run the unit tests**, open the PowerShell console and type: diff --git a/doc/README b/doc/README index e838b706ee7..d98c925c98c 100644 --- a/doc/README +++ b/doc/README @@ -29,6 +29,9 @@ libpmempool -- persistent memory pool management library pmempool -- persistent memory pool management tool daxio -- perform I/O on Device DAX device +NOTE: Support for Windows and FreeBSD are deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + These man pages provide the API specification for the corresponding libraries and commands in this source tree, so any updates to one should be tested, reviewed, and committed with changes to the other. diff --git a/doc/libpmem/libpmem.7.md b/doc/libpmem/libpmem.7.md index 7d3008a65fa..d1eacbde3ba 100644 --- a/doc/libpmem/libpmem.7.md +++ b/doc/libpmem/libpmem.7.md @@ -28,6 +28,10 @@ header: "pmem API version 1.1" **libpmem** - persistent memory support library +>NOTE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + # SYNOPSIS # ```c diff --git a/doc/libpmem2/libpmem2.7.md b/doc/libpmem2/libpmem2.7.md index dbb6d1751b2..926c8763678 100644 --- a/doc/libpmem2/libpmem2.7.md +++ b/doc/libpmem2/libpmem2.7.md @@ -28,6 +28,10 @@ header: "pmem2 API version 1.0" **libpmem2** - persistent memory support library +>NOTE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + # SYNOPSIS # ```c diff --git a/doc/libpmemblk/libpmemblk.7.md b/doc/libpmemblk/libpmemblk.7.md index 86393caef39..418ff63fb4b 100644 --- a/doc/libpmemblk/libpmemblk.7.md +++ b/doc/libpmemblk/libpmemblk.7.md @@ -28,6 +28,10 @@ header: "pmemblk API version 1.1" **libpmemblk** - persistent memory resident array of blocks (DEPRECATED) +>NOTE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + # SYNOPSIS # ```c diff --git a/doc/libpmemlog/libpmemlog.7.md b/doc/libpmemlog/libpmemlog.7.md index 0f2acf55ceb..8c7516ddd25 100644 --- a/doc/libpmemlog/libpmemlog.7.md +++ b/doc/libpmemlog/libpmemlog.7.md @@ -29,6 +29,10 @@ header: "pmemlog API version 1.1" **libpmemlog** - persistent memory resident log file (DEPRECATED) +>NOTE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + # SYNOPSIS # ```c diff --git a/doc/libpmemobj/libpmemobj.7.md b/doc/libpmemobj/libpmemobj.7.md index 4f5cab1d9b5..8551dac6a71 100644 --- a/doc/libpmemobj/libpmemobj.7.md +++ b/doc/libpmemobj/libpmemobj.7.md @@ -27,6 +27,10 @@ header: "pmemobj API version 2.3" **libpmemobj** - persistent memory transactional object store +>NOTE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + # SYNOPSIS # ```c diff --git a/doc/libpmempool/libpmempool.7.md b/doc/libpmempool/libpmempool.7.md index 16a0887548a..ce2ec7071ac 100644 --- a/doc/libpmempool/libpmempool.7.md +++ b/doc/libpmempool/libpmempool.7.md @@ -26,6 +26,10 @@ header: "pmempool API version 1.3" **libpmempool** - persistent memory pool management library +>NOTE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + # SYNOPSIS # ```c diff --git a/doc/pmempool/pmempool.1.md b/doc/pmempool/pmempool.1.md index a9f9fc843ea..f0fa2bb48e2 100644 --- a/doc/pmempool/pmempool.1.md +++ b/doc/pmempool/pmempool.1.md @@ -25,6 +25,10 @@ header: "pmem Tools version 1.4" **pmempool** - Persistent Memory Pool Management Tool +>NOTE: +Support for Windows is deprecated since PMDK 1.13.0 release +and will be removed in the PMDK 1.14.0 release. + # SYNOPSIS # ``` diff --git a/src/benchmarks/pmembench.vcxproj b/src/benchmarks/pmembench.vcxproj index 39779d3781a..62c5d49886e 100644 --- a/src/benchmarks/pmembench.vcxproj +++ b/src/benchmarks/pmembench.vcxproj @@ -218,7 +218,7 @@ false false - 4200 + 4200;4996 Console @@ -239,7 +239,7 @@ CompileAsCpp platform.h true - 4200 + 4200;4996 Console diff --git a/src/examples/libpmemobj/tree_map/rtree_map.vcxproj b/src/examples/libpmemobj/tree_map/rtree_map.vcxproj index a772e2aad2a..d3620e3555f 100644 --- a/src/examples/libpmemobj/tree_map/rtree_map.vcxproj +++ b/src/examples/libpmemobj/tree_map/rtree_map.vcxproj @@ -50,7 +50,7 @@ CompileAsCpp - 4200 + 4200;4996 diff --git a/src/include/libpmem.h b/src/include/libpmem.h index 5eb09309e95..b9ee83cf33f 100644 --- a/src/include/libpmem.h +++ b/src/include/libpmem.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * libpmem.h -- definitions of libpmem entry points @@ -27,6 +27,9 @@ #define pmem_map_file pmem_map_fileU #define pmem_check_version pmem_check_versionU #define pmem_errormsg pmem_errormsgU + +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) #endif #endif @@ -53,29 +56,82 @@ extern "C" { void *pmem_map_file(const char *path, size_t len, int flags, mode_t mode, size_t *mapped_lenp, int *is_pmemp); #else +WIN_DEPR_ATTR void *pmem_map_fileU(const char *path, size_t len, int flags, mode_t mode, size_t *mapped_lenp, int *is_pmemp); +WIN_DEPR_ATTR void *pmem_map_fileW(const wchar_t *path, size_t len, int flags, mode_t mode, size_t *mapped_lenp, int *is_pmemp); #endif +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_unmap(void *addr, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_is_pmem(const void *addr, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmem_persist(const void *addr, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_msync(const void *addr, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_has_auto_flush(void); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmem_flush(const void *addr, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmem_deep_flush(const void *addr, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_deep_drain(const void *addr, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_deep_persist(const void *addr, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmem_drain(void); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_has_hw_drain(void); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memmove_persist(void *pmemdest, const void *src, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memcpy_persist(void *pmemdest, const void *src, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memset_persist(void *pmemdest, int c, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memmove_nodrain(void *pmemdest, const void *src, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memcpy_nodrain(void *pmemdest, const void *src, size_t len); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memset_nodrain(void *pmemdest, int c, size_t len); #define PMEM_F_MEM_NODRAIN (1U << 0) @@ -95,8 +151,17 @@ void *pmem_memset_nodrain(void *pmemdest, int c, size_t len); PMEM_F_MEM_WB | \ PMEM_F_MEM_NOFLUSH) +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memmove(void *pmemdest, const void *src, size_t len, unsigned flags); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memcpy(void *pmemdest, const void *src, size_t len, unsigned flags); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem_memset(void *pmemdest, int c, size_t len, unsigned flags); /* @@ -112,8 +177,10 @@ void *pmem_memset(void *pmemdest, int c, size_t len, unsigned flags); const char *pmem_check_version(unsigned major_required, unsigned minor_required); #else +WIN_DEPR_ATTR const char *pmem_check_versionU(unsigned major_required, unsigned minor_required); +WIN_DEPR_ATTR const wchar_t *pmem_check_versionW(unsigned major_required, unsigned minor_required); #endif @@ -121,7 +188,9 @@ const wchar_t *pmem_check_versionW(unsigned major_required, #ifndef _WIN32 const char *pmem_errormsg(void); #else +WIN_DEPR_ATTR const char *pmem_errormsgU(void); +WIN_DEPR_ATTR const wchar_t *pmem_errormsgW(void); #endif diff --git a/src/include/libpmem2/async.h b/src/include/libpmem2/async.h index dab7a01d4f0..e209989233d 100644 --- a/src/include/libpmem2/async.h +++ b/src/include/libpmem2/async.h @@ -21,6 +21,8 @@ extern "C" { #define ASYNC_DEPR_STR "Async support for libpmem2 is deprecated." #ifdef _WIN32 #define ASYNC_DEPR_ATTR __declspec(deprecated(ASYNC_DEPR_STR)) +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) #else #define ASYNC_DEPR_ATTR __attribute__((deprecated(ASYNC_DEPR_STR))) #endif @@ -54,6 +56,9 @@ FUTURE(pmem2_persist_future, /* * Implementation of persist future, called upon future_poll */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif static inline enum future_state pmem2_persist_future_impl(struct future_context *ctx, struct future_notifier *notifier) @@ -80,6 +85,9 @@ union pmem2_finalize_future { /* * Returns a future for persisting data */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif static inline union pmem2_finalize_future pmem2_persist_future(struct pmem2_map *map, void *ptr, size_t size) { diff --git a/src/include/libpmem2/base.h b/src/include/libpmem2/base.h index 4e13f01151e..eca7d7e83c4 100644 --- a/src/include/libpmem2/base.h +++ b/src/include/libpmem2/base.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2019-2022, Intel Corporation */ +/* Copyright 2019-2023, Intel Corporation */ /* * libpmem2.h -- definitions of libpmem2 entry points @@ -29,6 +29,9 @@ #define pmem2_perror pmem2_perrorU #endif +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) + #endif #ifdef __cplusplus @@ -77,25 +80,48 @@ extern "C" { struct pmem2_source; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_from_fd(struct pmem2_source **src, int fd); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_from_anon(struct pmem2_source **src, size_t size); #ifdef _WIN32 +WIN_DEPR_ATTR int pmem2_source_from_handle(struct pmem2_source **src, HANDLE handle); +WIN_DEPR_ATTR int pmem2_source_get_handle(const struct pmem2_source *src, HANDLE *h); #else int pmem2_source_get_fd(const struct pmem2_source *src, int *fd); #endif +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_size(const struct pmem2_source *src, size_t *size); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_alignment(const struct pmem2_source *src, size_t *alignment); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_delete(struct pmem2_source **src); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_pread_mcsafe(struct pmem2_source *src, void *buf, size_t size, size_t offset); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_pwrite_mcsafe(struct pmem2_source *src, void *buf, size_t size, size_t offset); @@ -104,32 +130,65 @@ int pmem2_source_pwrite_mcsafe(struct pmem2_source *src, void *buf, size_t size, struct pmem2_map; struct pmem2_vm_reservation; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem2_vm_reservation_get_address(struct pmem2_vm_reservation *rsv); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif size_t pmem2_vm_reservation_get_size(struct pmem2_vm_reservation *rsv); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_new(struct pmem2_vm_reservation **rsv_ptr, void *addr, size_t size); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_delete(struct pmem2_vm_reservation **rsv_ptr); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_extend(struct pmem2_vm_reservation *rsv, size_t size); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_shrink(struct pmem2_vm_reservation *rsv, size_t offset, size_t size); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_map_find(struct pmem2_vm_reservation *rsv, size_t reserv_offset, size_t len, struct pmem2_map **map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_map_find_prev(struct pmem2_vm_reservation *rsv, struct pmem2_map *map, struct pmem2_map **prev_map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_map_find_next(struct pmem2_vm_reservation *rsv, struct pmem2_map *map, struct pmem2_map **next_map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_map_find_first(struct pmem2_vm_reservation *rsv, struct pmem2_map **map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_vm_reservation_map_find_last(struct pmem2_vm_reservation *rsv, struct pmem2_map **map); @@ -137,8 +196,14 @@ int pmem2_vm_reservation_map_find_last(struct pmem2_vm_reservation *rsv, struct pmem2_config; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_config_new(struct pmem2_config **cfg); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_config_delete(struct pmem2_config **cfg); enum pmem2_granularity { @@ -147,11 +212,20 @@ enum pmem2_granularity { PMEM2_GRANULARITY_PAGE, }; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_config_set_required_store_granularity(struct pmem2_config *cfg, enum pmem2_granularity g); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_config_set_offset(struct pmem2_config *cfg, size_t offset); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_config_set_length(struct pmem2_config *cfg, size_t length); enum pmem2_sharing_type { @@ -159,6 +233,9 @@ enum pmem2_sharing_type { PMEM2_PRIVATE, }; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_config_set_sharing(struct pmem2_config *cfg, enum pmem2_sharing_type type); @@ -167,41 +244,83 @@ int pmem2_config_set_sharing(struct pmem2_config *cfg, #define PMEM2_PROT_WRITE (1U << 31) #define PMEM2_PROT_NONE 0 +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_config_set_protection(struct pmem2_config *cfg, unsigned prot); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_config_set_vm_reservation(struct pmem2_config *cfg, struct pmem2_vm_reservation *rsv, size_t offset); /* mapping */ struct pmem2_map; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_map_from_existing(struct pmem2_map **map, const struct pmem2_source *src, void *addr, size_t len, enum pmem2_granularity gran); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_map_new(struct pmem2_map **map_ptr, const struct pmem2_config *cfg, const struct pmem2_source *src); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_map_delete(struct pmem2_map **map_ptr); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmem2_map_get_address(struct pmem2_map *map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif size_t pmem2_map_get_size(struct pmem2_map *map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif enum pmem2_granularity pmem2_map_get_store_granularity(struct pmem2_map *map); /* flushing */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif typedef void (*pmem2_persist_fn)(const void *ptr, size_t size); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif typedef void (*pmem2_flush_fn)(const void *ptr, size_t size); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif typedef void (*pmem2_drain_fn)(void); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem2_persist_fn pmem2_get_persist_fn(struct pmem2_map *map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem2_flush_fn pmem2_get_flush_fn(struct pmem2_map *map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem2_drain_fn pmem2_get_drain_fn(struct pmem2_map *map); #define PMEM2_F_MEM_NODRAIN (1U << 0) @@ -221,38 +340,66 @@ pmem2_drain_fn pmem2_get_drain_fn(struct pmem2_map *map); PMEM2_F_MEM_WB | \ PMEM2_F_MEM_NOFLUSH) +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif typedef void *(*pmem2_memmove_fn)(void *pmemdest, const void *src, size_t len, unsigned flags); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif typedef void *(*pmem2_memcpy_fn)(void *pmemdest, const void *src, size_t len, unsigned flags); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif typedef void *(*pmem2_memset_fn)(void *pmemdest, int c, size_t len, unsigned flags); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem2_memmove_fn pmem2_get_memmove_fn(struct pmem2_map *map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem2_memcpy_fn pmem2_get_memcpy_fn(struct pmem2_map *map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem2_memset_fn pmem2_get_memset_fn(struct pmem2_map *map); /* RAS */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_deep_flush(struct pmem2_map *map, void *ptr, size_t size); #ifndef _WIN32 int pmem2_source_device_id(const struct pmem2_source *src, char *id, size_t *len); #else +WIN_DEPR_ATTR int pmem2_source_device_idW(const struct pmem2_source *src, wchar_t *id, size_t *len); - +WIN_DEPR_ATTR int pmem2_source_device_idU(const struct pmem2_source *src, char *id, size_t *len); #endif +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_device_usc(const struct pmem2_source *src, uint64_t *usc); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_source_numa_node(const struct pmem2_source *src, int *numa_node); struct pmem2_badblock_context; @@ -262,15 +409,27 @@ struct pmem2_badblock { size_t length; }; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_badblock_context_new(struct pmem2_badblock_context **bbctx, const struct pmem2_source *src); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_badblock_next(struct pmem2_badblock_context *bbctx, struct pmem2_badblock *bb); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmem2_badblock_context_delete( struct pmem2_badblock_context **bbctx); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_badblock_clear(struct pmem2_badblock_context *bbctx, const struct pmem2_badblock *bb); @@ -279,19 +438,24 @@ int pmem2_badblock_clear(struct pmem2_badblock_context *bbctx, #ifndef _WIN32 const char *pmem2_errormsg(void); #else +WIN_DEPR_ATTR const char *pmem2_errormsgU(void); - +WIN_DEPR_ATTR const wchar_t *pmem2_errormsgW(void); #endif +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem2_err_to_errno(int); #ifndef _WIN32 void pmem2_perror(const char *format, ...) __attribute__((__format__(__printf__, 1, 2))); #else +WIN_DEPR_ATTR void pmem2_perrorU(const char *format, ...); - +WIN_DEPR_ATTR void pmem2_perrorW(const wchar_t *format, ...); #endif diff --git a/src/include/libpmemblk.h b/src/include/libpmemblk.h index 4e3a64104f5..22afd617947 100644 --- a/src/include/libpmemblk.h +++ b/src/include/libpmemblk.h @@ -43,17 +43,19 @@ #endif -#ifdef __cplusplus -extern "C" { -#endif - #define BLK_DEPR_STR "Libpmemblk is deprecated." #ifdef _WIN32 #define PMEMBLK_DEPR_ATTR __declspec(deprecated(BLK_DEPR_STR)) +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) #else #define PMEMBLK_DEPR_ATTR __attribute__((deprecated(BLK_DEPR_STR))) #endif +#ifdef __cplusplus +extern "C" { +#endif + /* * opaque type, internal to libpmemblk */ @@ -73,10 +75,10 @@ PMEMBLK_DEPR_ATTR const char *pmemblk_check_version(unsigned major_required, unsigned minor_required); #else -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR const char *pmemblk_check_versionU( unsigned major_required, unsigned minor_required); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR const wchar_t *pmemblk_check_versionW(unsigned major_required, unsigned minor_required); #endif @@ -111,9 +113,9 @@ const wchar_t *pmemblk_check_versionW(unsigned major_required, PMEMBLK_DEPR_ATTR PMEMblkpool *pmemblk_open(const char *path, size_t bsize); #else -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR PMEMblkpool *pmemblk_openU(const char *path, size_t bsize); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR PMEMblkpool *pmemblk_openW(const wchar_t *path, size_t bsize); #endif @@ -122,10 +124,10 @@ PMEMBLK_DEPR_ATTR PMEMblkpool *pmemblk_create(const char *path, size_t bsize, size_t poolsize, mode_t mode); #else -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR PMEMblkpool *pmemblk_createU(const char *path, size_t bsize, size_t poolsize, mode_t mode); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR PMEMblkpool *pmemblk_createW(const wchar_t *path, size_t bsize, size_t poolsize, mode_t mode); #endif @@ -134,9 +136,9 @@ PMEMblkpool *pmemblk_createW(const wchar_t *path, size_t bsize, PMEMBLK_DEPR_ATTR int pmemblk_check(const char *path, size_t bsize); #else -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR int pmemblk_checkU(const char *path, size_t bsize); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR int pmemblk_checkW(const wchar_t *path, size_t bsize); #endif @@ -172,9 +174,9 @@ void pmemblk_set_funcs( PMEMBLK_DEPR_ATTR const char *pmemblk_errormsg(void); #else -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR const char *pmemblk_errormsgU(void); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR const wchar_t *pmemblk_errormsgW(void); #endif @@ -187,17 +189,17 @@ int pmemblk_ctl_set(PMEMblkpool *pbp, const char *name, void *arg); PMEMBLK_DEPR_ATTR int pmemblk_ctl_exec(PMEMblkpool *pbp, const char *name, void *arg); #else -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR int pmemblk_ctl_getU(PMEMblkpool *pbp, const char *name, void *arg); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR int pmemblk_ctl_getW(PMEMblkpool *pbp, const wchar_t *name, void *arg); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR int pmemblk_ctl_setU(PMEMblkpool *pbp, const char *name, void *arg); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR int pmemblk_ctl_setW(PMEMblkpool *pbp, const wchar_t *name, void *arg); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR int pmemblk_ctl_execU(PMEMblkpool *pbp, const char *name, void *arg); -PMEMBLK_DEPR_ATTR +WIN_DEPR_ATTR int pmemblk_ctl_execW(PMEMblkpool *pbp, const wchar_t *name, void *arg); #endif diff --git a/src/include/libpmemlog.h b/src/include/libpmemlog.h index c626e20cbb1..59f0eba1d51 100644 --- a/src/include/libpmemlog.h +++ b/src/include/libpmemlog.h @@ -52,6 +52,8 @@ extern "C" { #define LOG_DEPR_STR "Libpmemlog is deprecated." #ifdef _WIN32 #define PMEMLOG_DEPR_ATTR __declspec(deprecated(LOG_DEPR_STR)) +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) #else #define PMEMLOG_DEPR_ATTR __attribute__((deprecated(LOG_DEPR_STR))) #endif @@ -76,10 +78,10 @@ PMEMLOG_DEPR_ATTR const char *pmemlog_check_version(unsigned major_required, unsigned minor_required); #else -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR const char *pmemlog_check_versionU(unsigned major_required, unsigned minor_required); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR const wchar_t *pmemlog_check_versionW(unsigned major_required, unsigned minor_required); #endif @@ -99,9 +101,9 @@ const wchar_t *pmemlog_check_versionW(unsigned major_required, PMEMLOG_DEPR_ATTR PMEMlogpool *pmemlog_open(const char *path); #else -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR PMEMlogpool *pmemlog_openU(const char *path); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR PMEMlogpool *pmemlog_openW(const wchar_t *path); #endif @@ -109,9 +111,9 @@ PMEMlogpool *pmemlog_openW(const wchar_t *path); PMEMLOG_DEPR_ATTR PMEMlogpool *pmemlog_create(const char *path, size_t poolsize, mode_t mode); #else -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR PMEMlogpool *pmemlog_createU(const char *path, size_t poolsize, mode_t mode); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR PMEMlogpool *pmemlog_createW(const wchar_t *path, size_t poolsize, mode_t mode); #endif @@ -119,9 +121,9 @@ PMEMlogpool *pmemlog_createW(const wchar_t *path, size_t poolsize, mode_t mode); PMEMLOG_DEPR_ATTR int pmemlog_check(const char *path); #else -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR int pmemlog_checkU(const char *path); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR int pmemlog_checkW(const wchar_t *path); #endif @@ -158,9 +160,9 @@ void pmemlog_set_funcs( PMEMLOG_DEPR_ATTR const char *pmemlog_errormsg(void); #else -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR const char *pmemlog_errormsgU(void); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR const wchar_t *pmemlog_errormsgW(void); #endif @@ -173,17 +175,17 @@ int pmemlog_ctl_set(PMEMlogpool *plp, const char *name, void *arg); PMEMLOG_DEPR_ATTR int pmemlog_ctl_exec(PMEMlogpool *plp, const char *name, void *arg); #else -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR int pmemlog_ctl_getU(PMEMlogpool *plp, const char *name, void *arg); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR int pmemlog_ctl_getW(PMEMlogpool *plp, const wchar_t *name, void *arg); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR int pmemlog_ctl_setU(PMEMlogpool *plp, const char *name, void *arg); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR int pmemlog_ctl_setW(PMEMlogpool *plp, const wchar_t *name, void *arg); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR int pmemlog_ctl_execU(PMEMlogpool *plp, const char *name, void *arg); -PMEMLOG_DEPR_ATTR +WIN_DEPR_ATTR int pmemlog_ctl_execW(PMEMlogpool *plp, const wchar_t *name, void *arg); #endif diff --git a/src/include/libpmemobj/action_base.h b/src/include/libpmemobj/action_base.h index e9d3e93ba34..bc3b91a637b 100644 --- a/src/include/libpmemobj/action_base.h +++ b/src/include/libpmemobj/action_base.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2017-2020, Intel Corporation */ +/* Copyright 2017-2023, Intel Corporation */ /* * libpmemobj/action_base.h -- definitions of libpmemobj action interface @@ -51,20 +51,44 @@ struct pobj_action { POBJ_XALLOC_ARENA_MASK |\ POBJ_XALLOC_ZERO) +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_reserve(PMEMobjpool *pop, struct pobj_action *act, size_t size, uint64_t type_num); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_xreserve(PMEMobjpool *pop, struct pobj_action *act, size_t size, uint64_t type_num, uint64_t flags); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_set_value(PMEMobjpool *pop, struct pobj_action *act, uint64_t *ptr, uint64_t value); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_defer_free(PMEMobjpool *pop, PMEMoid oid, struct pobj_action *act); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_publish(PMEMobjpool *pop, struct pobj_action *actv, size_t actvcnt); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_publish(struct pobj_action *actv, size_t actvcnt); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_xpublish(struct pobj_action *actv, size_t actvcnt, uint64_t flags); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_cancel(PMEMobjpool *pop, struct pobj_action *actv, size_t actvcnt); #ifdef __cplusplus diff --git a/src/include/libpmemobj/atomic_base.h b/src/include/libpmemobj/atomic_base.h index b2058f54ff5..c3f3a5be3db 100644 --- a/src/include/libpmemobj/atomic_base.h +++ b/src/include/libpmemobj/atomic_base.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * libpmemobj/atomic_base.h -- definitions of libpmemobj atomic entry points @@ -30,12 +30,18 @@ extern "C" { * initialized, or if it's interrupted before the constructor completes, the * memory reserved for the object is automatically reclaimed. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_alloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size, uint64_t type_num, pmemobj_constr constructor, void *arg); /* * Allocates with flags a new object from the pool. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_xalloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size, uint64_t type_num, uint64_t flags, pmemobj_constr constructor, void *arg); @@ -43,36 +49,54 @@ int pmemobj_xalloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size, /* * Allocates a new zeroed object from the pool. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_zalloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size, uint64_t type_num); /* * Resizes an existing object. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_realloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size, uint64_t type_num); /* * Resizes an existing object, if extended new space is zeroed. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_zrealloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size, uint64_t type_num); /* * Allocates a new object with duplicate of the string s. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_strdup(PMEMobjpool *pop, PMEMoid *oidp, const char *s, uint64_t type_num); /* * Allocates a new object with duplicate of the wide character string s. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_wcsdup(PMEMobjpool *pop, PMEMoid *oidp, const wchar_t *s, uint64_t type_num); /* * Frees an existing object. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_free(PMEMoid *oidp); struct pobj_defrag_result { @@ -83,6 +107,9 @@ struct pobj_defrag_result { /* * Performs defragmentation on the provided array of objects. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_defrag(PMEMobjpool *pop, PMEMoid **oidv, size_t oidcnt, struct pobj_defrag_result *result); diff --git a/src/include/libpmemobj/base.h b/src/include/libpmemobj/base.h index ebb30d80177..acec5f3a0f1 100644 --- a/src/include/libpmemobj/base.h +++ b/src/include/libpmemobj/base.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * libpmemobj/base.h -- definitions of base libpmemobj entry points @@ -26,6 +26,9 @@ #define pmemobj_errormsg pmemobj_errormsgU #endif +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) + #endif #ifdef __cplusplus @@ -93,7 +96,13 @@ static const PMEMoid OID_NULL = { 0, 0 }; ((lhs).off == (rhs).off &&\ (lhs).pool_uuid_lo == (rhs).pool_uuid_lo) +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMobjpool *pmemobj_pool_by_ptr(const void *addr); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMobjpool *pmemobj_pool_by_oid(PMEMoid oid); #ifndef _WIN32 @@ -137,6 +146,9 @@ pmemobj_direct_inline(PMEMoid oid) */ #if defined(_WIN32) || defined(_PMEMOBJ_INTRNL) ||\ defined(PMEMOBJ_DIRECT_NON_INLINE) +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_direct(PMEMoid oid); #else #define pmemobj_direct pmemobj_direct_inline @@ -155,6 +167,9 @@ struct {\ /* * Returns lazily initialized volatile variable. (EXPERIMENTAL) */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_volatile(PMEMobjpool *pop, struct pmemvlt *vlt, void *ptr, size_t size, int (*constr)(void *ptr, void *arg), void *arg); @@ -162,6 +177,9 @@ void *pmemobj_volatile(PMEMobjpool *pop, struct pmemvlt *vlt, /* * Returns the OID of the object pointed to by addr. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_oid(const void *addr); /* @@ -170,11 +188,17 @@ PMEMoid pmemobj_oid(const void *addr); * * Can be used with objects allocated by any of the available methods. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif size_t pmemobj_alloc_usable_size(PMEMoid oid); /* * Returns the type number of the object. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif uint64_t pmemobj_type_num(PMEMoid oid); /* @@ -189,18 +213,27 @@ uint64_t pmemobj_type_num(PMEMoid oid); /* * Pmemobj version of memcpy. Data copied is made persistent. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_memcpy_persist(PMEMobjpool *pop, void *dest, const void *src, size_t len); /* * Pmemobj version of memset. Data range set is made persistent. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_memset_persist(PMEMobjpool *pop, void *dest, int c, size_t len); /* * Pmemobj version of memcpy. Data copied is made persistent (unless opted-out * using flags). */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_memcpy(PMEMobjpool *pop, void *dest, const void *src, size_t len, unsigned flags); @@ -208,6 +241,9 @@ void *pmemobj_memcpy(PMEMobjpool *pop, void *dest, const void *src, size_t len, * Pmemobj version of memmove. Data copied is made persistent (unless opted-out * using flags). */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_memmove(PMEMobjpool *pop, void *dest, const void *src, size_t len, unsigned flags); @@ -215,34 +251,52 @@ void *pmemobj_memmove(PMEMobjpool *pop, void *dest, const void *src, size_t len, * Pmemobj version of memset. Data range set is made persistent (unless * opted-out using flags). */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_memset(PMEMobjpool *pop, void *dest, int c, size_t len, unsigned flags); /* * Pmemobj version of pmem_persist. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_persist(PMEMobjpool *pop, const void *addr, size_t len); /* * Pmemobj version of pmem_persist with additional flags argument. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_xpersist(PMEMobjpool *pop, const void *addr, size_t len, unsigned flags); /* * Pmemobj version of pmem_flush. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_flush(PMEMobjpool *pop, const void *addr, size_t len); /* * Pmemobj version of pmem_flush with additional flags argument. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_xflush(PMEMobjpool *pop, const void *addr, size_t len, unsigned flags); /* * Pmemobj version of pmem_drain. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_drain(PMEMobjpool *pop); /* @@ -262,8 +316,10 @@ void pmemobj_drain(PMEMobjpool *pop); const char *pmemobj_check_version(unsigned major_required, unsigned minor_required); #else +WIN_DEPR_ATTR const char *pmemobj_check_versionU(unsigned major_required, unsigned minor_required); +WIN_DEPR_ATTR const wchar_t *pmemobj_check_versionW(unsigned major_required, unsigned minor_required); #endif @@ -273,23 +329,34 @@ const wchar_t *pmemobj_check_versionW(unsigned major_required, * default for that function. The replacement functions must not make calls * back into libpmemobj. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_set_funcs( void *(*malloc_func)(size_t size), void (*free_func)(void *ptr), void *(*realloc_func)(void *ptr, size_t size), char *(*strdup_func)(const char *s)); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif typedef int (*pmemobj_constr)(PMEMobjpool *pop, void *ptr, void *arg); /* * (debug helper function) logs notice message if used inside a transaction */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void _pobj_debug_notice(const char *func_name, const char *file, int line); #ifndef _WIN32 const char *pmemobj_errormsg(void); #else +WIN_DEPR_ATTR const char *pmemobj_errormsgU(void); +WIN_DEPR_ATTR const wchar_t *pmemobj_errormsgW(void); #endif diff --git a/src/include/libpmemobj/ctl.h b/src/include/libpmemobj/ctl.h index ed456f67175..ae6c2ef1ad1 100644 --- a/src/include/libpmemobj/ctl.h +++ b/src/include/libpmemobj/ctl.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2017-2021, Intel Corporation */ +/* Copyright 2017-2023, Intel Corporation */ /* * libpmemobj/ctl.h -- definitions of pmemobj_ctl related entry points @@ -155,11 +155,17 @@ int pmemobj_ctl_get(PMEMobjpool *pop, const char *name, void *arg); int pmemobj_ctl_set(PMEMobjpool *pop, const char *name, void *arg); int pmemobj_ctl_exec(PMEMobjpool *pop, const char *name, void *arg); #else +WIN_DEPR_ATTR int pmemobj_ctl_getU(PMEMobjpool *pop, const char *name, void *arg); +WIN_DEPR_ATTR int pmemobj_ctl_getW(PMEMobjpool *pop, const wchar_t *name, void *arg); +WIN_DEPR_ATTR int pmemobj_ctl_setU(PMEMobjpool *pop, const char *name, void *arg); +WIN_DEPR_ATTR int pmemobj_ctl_setW(PMEMobjpool *pop, const wchar_t *name, void *arg); +WIN_DEPR_ATTR int pmemobj_ctl_execU(PMEMobjpool *pop, const char *name, void *arg); +WIN_DEPR_ATTR int pmemobj_ctl_execW(PMEMobjpool *pop, const wchar_t *name, void *arg); #ifndef PMDK_UTF8_API diff --git a/src/include/libpmemobj/iterator_base.h b/src/include/libpmemobj/iterator_base.h index 76076bc866c..4c56b1fe0d1 100644 --- a/src/include/libpmemobj/iterator_base.h +++ b/src/include/libpmemobj/iterator_base.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * libpmemobj/iterator_base.h -- definitions of libpmemobj iterator entry points @@ -25,11 +25,17 @@ extern "C" { /* * Returns the first object of the specified type number. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_first(PMEMobjpool *pop); /* * Returns the next object of the same type. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_next(PMEMoid oid); #ifdef __cplusplus diff --git a/src/include/libpmemobj/lists_atomic_base.h b/src/include/libpmemobj/lists_atomic_base.h index be80d1db5ab..10832b5a263 100644 --- a/src/include/libpmemobj/lists_atomic_base.h +++ b/src/include/libpmemobj/lists_atomic_base.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * libpmemobj/lists_atomic_base.h -- definitions of libpmemobj atomic lists @@ -18,16 +18,28 @@ extern "C" { * Non-transactional persistent atomic circular doubly-linked list */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_list_insert(PMEMobjpool *pop, size_t pe_offset, void *head, PMEMoid dest, int before, PMEMoid oid); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_list_insert_new(PMEMobjpool *pop, size_t pe_offset, void *head, PMEMoid dest, int before, size_t size, uint64_t type_num, pmemobj_constr constructor, void *arg); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_list_remove(PMEMobjpool *pop, size_t pe_offset, void *head, PMEMoid oid, int free); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_list_move(PMEMobjpool *pop, size_t pe_old_offset, void *head_old, size_t pe_new_offset, void *head_new, PMEMoid dest, int before, PMEMoid oid); diff --git a/src/include/libpmemobj/pool_base.h b/src/include/libpmemobj/pool_base.h index 303e69f3483..259b9d7b269 100644 --- a/src/include/libpmemobj/pool_base.h +++ b/src/include/libpmemobj/pool_base.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * libpmemobj/pool_base.h -- definitions of libpmemobj pool entry points @@ -38,12 +38,15 @@ extern "C" { #define pmemobj_create pmemobj_createU #define pmemobj_check pmemobj_checkU #endif + #endif #ifndef _WIN32 PMEMobjpool *pmemobj_open(const char *path, const char *layout); #else +WIN_DEPR_ATTR PMEMobjpool *pmemobj_openU(const char *path, const char *layout); +WIN_DEPR_ATTR PMEMobjpool *pmemobj_openW(const wchar_t *path, const wchar_t *layout); #endif @@ -51,8 +54,10 @@ PMEMobjpool *pmemobj_openW(const wchar_t *path, const wchar_t *layout); PMEMobjpool *pmemobj_create(const char *path, const char *layout, size_t poolsize, mode_t mode); #else +WIN_DEPR_ATTR PMEMobjpool *pmemobj_createU(const char *path, const char *layout, size_t poolsize, mode_t mode); +WIN_DEPR_ATTR PMEMobjpool *pmemobj_createW(const wchar_t *path, const wchar_t *layout, size_t poolsize, mode_t mode); #endif @@ -60,10 +65,15 @@ PMEMobjpool *pmemobj_createW(const wchar_t *path, const wchar_t *layout, #ifndef _WIN32 int pmemobj_check(const char *path, const char *layout); #else +WIN_DEPR_ATTR int pmemobj_checkU(const char *path, const char *layout); +WIN_DEPR_ATTR int pmemobj_checkW(const wchar_t *path, const wchar_t *layout); #endif +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_close(PMEMobjpool *pop); /* * If called for the first time on a newly created pool, the root object @@ -74,12 +84,18 @@ void pmemobj_close(PMEMobjpool *pop); * * This function is thread-safe. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_root(PMEMobjpool *pop, size_t size); /* * Same as above, but calls the constructor function when the object is first * created and on all subsequent reallocations. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_root_construct(PMEMobjpool *pop, size_t size, pmemobj_constr constructor, void *arg); @@ -87,16 +103,25 @@ PMEMoid pmemobj_root_construct(PMEMobjpool *pop, size_t size, * Returns the size in bytes of the root object. Always equal to the requested * size. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif size_t pmemobj_root_size(PMEMobjpool *pop); /* * Sets volatile pointer to the user data for specified pool. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_set_user_data(PMEMobjpool *pop, void *data); /* * Gets volatile pointer to the user data associated with the specified pool. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_get_user_data(PMEMobjpool *pop); #ifdef __cplusplus diff --git a/src/include/libpmemobj/thread.h b/src/include/libpmemobj/thread.h index 23bc4701b60..61645253b73 100644 --- a/src/include/libpmemobj/thread.h +++ b/src/include/libpmemobj/thread.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * libpmemobj/thread.h -- definitions of libpmemobj thread/locking entry points @@ -35,32 +35,86 @@ typedef union { char padding[_POBJ_CL_SIZE]; } PMEMcond; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_mutex_zero(PMEMobjpool *pop, PMEMmutex *mutexp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_mutex_lock(PMEMobjpool *pop, PMEMmutex *mutexp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_mutex_timedlock(PMEMobjpool *pop, PMEMmutex *__restrict mutexp, const struct timespec *__restrict abs_timeout); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_mutex_trylock(PMEMobjpool *pop, PMEMmutex *mutexp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_mutex_unlock(PMEMobjpool *pop, PMEMmutex *mutexp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_rwlock_zero(PMEMobjpool *pop, PMEMrwlock *rwlockp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_rwlock_rdlock(PMEMobjpool *pop, PMEMrwlock *rwlockp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_rwlock_wrlock(PMEMobjpool *pop, PMEMrwlock *rwlockp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_rwlock_timedrdlock(PMEMobjpool *pop, PMEMrwlock *__restrict rwlockp, const struct timespec *__restrict abs_timeout); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_rwlock_timedwrlock(PMEMobjpool *pop, PMEMrwlock *__restrict rwlockp, const struct timespec *__restrict abs_timeout); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_rwlock_tryrdlock(PMEMobjpool *pop, PMEMrwlock *rwlockp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_rwlock_trywrlock(PMEMobjpool *pop, PMEMrwlock *rwlockp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_rwlock_unlock(PMEMobjpool *pop, PMEMrwlock *rwlockp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_cond_zero(PMEMobjpool *pop, PMEMcond *condp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_cond_broadcast(PMEMobjpool *pop, PMEMcond *condp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_cond_signal(PMEMobjpool *pop, PMEMcond *condp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_cond_timedwait(PMEMobjpool *pop, PMEMcond *__restrict condp, PMEMmutex *__restrict mutexp, const struct timespec *__restrict abs_timeout); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_cond_wait(PMEMobjpool *pop, PMEMcond *condp, PMEMmutex *__restrict mutexp); diff --git a/src/include/libpmemobj/tx_base.h b/src/include/libpmemobj/tx_base.h index 3bb8032e51d..48b50f50253 100644 --- a/src/include/libpmemobj/tx_base.h +++ b/src/include/libpmemobj/tx_base.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * libpmemobj/tx_base.h -- definitions of libpmemobj transactional entry points @@ -131,6 +131,9 @@ typedef void (*pmemobj_tx_callback)(PMEMobjpool *pop, enum pobj_tx_stage stage, * returns zero. Otherwise, stage changes to TX_STAGE_ONABORT and an error * number is returned. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_begin(PMEMobjpool *pop, jmp_buf env, ...); /* @@ -139,11 +142,17 @@ int pmemobj_tx_begin(PMEMobjpool *pop, jmp_buf env, ...); * - POBJ_XLOCK_NO_ABORT - if the function does not end successfully, * do not abort the transaction and return the error number. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_xlock(enum pobj_tx_param type, void *lockp, uint64_t flags); /* * Adds lock of given type to current transaction. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_lock(enum pobj_tx_param type, void *lockp); /* @@ -153,6 +162,9 @@ int pmemobj_tx_lock(enum pobj_tx_param type, void *lockp); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_tx_abort(int errnum); /* @@ -160,6 +172,9 @@ void pmemobj_tx_abort(int errnum); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_tx_commit(void); /* @@ -175,6 +190,9 @@ void pmemobj_tx_commit(void); * * This function must *not* be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_end(void); /* @@ -184,11 +202,17 @@ int pmemobj_tx_end(void); * * This function must be called in transaction. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_tx_process(void); /* * Returns last transaction error code. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_errno(void); /* @@ -203,6 +227,9 @@ int pmemobj_tx_errno(void); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_add_range(PMEMoid oid, uint64_t off, size_t size); /* @@ -217,6 +244,9 @@ int pmemobj_tx_add_range(PMEMoid oid, uint64_t off, size_t size); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_add_range_direct(const void *ptr, size_t size); /* @@ -228,6 +258,9 @@ int pmemobj_tx_add_range_direct(const void *ptr, size_t size); * - POBJ_XADD_NO_ABORT - if the function does not end successfully, * do not abort the transaction and return the error number. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_xadd_range(PMEMoid oid, uint64_t off, size_t size, uint64_t flags); @@ -240,6 +273,9 @@ int pmemobj_tx_xadd_range(PMEMoid oid, uint64_t off, size_t size, * - POBJ_XADD_NO_ABORT - if the function does not end successfully, * do not abort the transaction and return the error number. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_xadd_range_direct(const void *ptr, size_t size, uint64_t flags); /* @@ -250,6 +286,9 @@ int pmemobj_tx_xadd_range_direct(const void *ptr, size_t size, uint64_t flags); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_alloc(size_t size, uint64_t type_num); /* @@ -265,6 +304,9 @@ PMEMoid pmemobj_tx_alloc(size_t size, uint64_t type_num); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_xalloc(size_t size, uint64_t type_num, uint64_t flags); /* @@ -275,6 +317,9 @@ PMEMoid pmemobj_tx_xalloc(size_t size, uint64_t type_num, uint64_t flags); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_zalloc(size_t size, uint64_t type_num); /* @@ -285,6 +330,9 @@ PMEMoid pmemobj_tx_zalloc(size_t size, uint64_t type_num); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_realloc(PMEMoid oid, size_t size, uint64_t type_num); /* @@ -295,6 +343,9 @@ PMEMoid pmemobj_tx_realloc(PMEMoid oid, size_t size, uint64_t type_num); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_zrealloc(PMEMoid oid, size_t size, uint64_t type_num); /* @@ -305,6 +356,9 @@ PMEMoid pmemobj_tx_zrealloc(PMEMoid oid, size_t size, uint64_t type_num); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_strdup(const char *s, uint64_t type_num); /* @@ -320,6 +374,9 @@ PMEMoid pmemobj_tx_strdup(const char *s, uint64_t type_num); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_xstrdup(const char *s, uint64_t type_num, uint64_t flags); /* @@ -331,6 +388,9 @@ PMEMoid pmemobj_tx_xstrdup(const char *s, uint64_t type_num, uint64_t flags); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_wcsdup(const wchar_t *s, uint64_t type_num); /* @@ -347,6 +407,9 @@ PMEMoid pmemobj_tx_wcsdup(const wchar_t *s, uint64_t type_num); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif PMEMoid pmemobj_tx_xwcsdup(const wchar_t *s, uint64_t type_num, uint64_t flags); /* @@ -357,6 +420,9 @@ PMEMoid pmemobj_tx_xwcsdup(const wchar_t *s, uint64_t type_num, uint64_t flags); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_free(PMEMoid oid); /* @@ -371,6 +437,9 @@ int pmemobj_tx_free(PMEMoid oid); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_xfree(PMEMoid oid, uint64_t flags); /* @@ -381,6 +450,9 @@ int pmemobj_tx_xfree(PMEMoid oid, uint64_t flags); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_log_append_buffer(enum pobj_log_type type, void *addr, size_t size); @@ -395,6 +467,9 @@ int pmemobj_tx_log_append_buffer(enum pobj_log_type type, * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_xlog_append_buffer(enum pobj_log_type type, void *addr, size_t size, uint64_t flags); @@ -406,27 +481,42 @@ int pmemobj_tx_xlog_append_buffer(enum pobj_log_type type, * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmemobj_tx_log_auto_alloc(enum pobj_log_type type, int on_off); /* * Calculates and returns size for user buffers for snapshots. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif size_t pmemobj_tx_log_snapshots_max_size(size_t *sizes, size_t nsizes); /* * Calculates and returns size for user buffers for intents. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif size_t pmemobj_tx_log_intents_max_size(size_t nintents); /* * Sets volatile pointer to the user data for the current transaction. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_tx_set_user_data(void *data); /* * Gets volatile pointer to the user data associated with the current * transaction. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pmemobj_tx_get_user_data(void); /* @@ -434,6 +524,9 @@ void *pmemobj_tx_get_user_data(void); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmemobj_tx_set_failure_behavior(enum pobj_tx_failure_behavior behavior); /* @@ -441,6 +534,9 @@ void pmemobj_tx_set_failure_behavior(enum pobj_tx_failure_behavior behavior); * * This function must be called during TX_STAGE_WORK. */ +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif enum pobj_tx_failure_behavior pmemobj_tx_get_failure_behavior(void); #ifdef __cplusplus diff --git a/src/include/libpmempool.h b/src/include/libpmempool.h index 2c69910ec78..c5cad05303a 100644 --- a/src/include/libpmempool.h +++ b/src/include/libpmempool.h @@ -47,6 +47,9 @@ #define pmempool_feature_query pmempool_feature_queryU #endif +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) + #endif #ifdef __cplusplus @@ -210,10 +213,12 @@ struct pmempool_check_argsW { PMEMpoolcheck * pmempool_check_init(struct pmempool_check_args *args, size_t args_size); #else -PMEMpoolcheck * -pmempool_check_initU(struct pmempool_check_argsU *args, size_t args_size); -PMEMpoolcheck * -pmempool_check_initW(struct pmempool_check_argsW *args, size_t args_size); +WIN_DEPR_ATTR +PMEMpoolcheck *pmempool_check_initU(struct pmempool_check_argsU *args, + size_t args_size); +WIN_DEPR_ATTR +PMEMpoolcheck *pmempool_check_initW(struct pmempool_check_argsW *args, + size_t args_size); #endif /* @@ -222,7 +227,9 @@ pmempool_check_initW(struct pmempool_check_argsW *args, size_t args_size); #ifndef _WIN32 struct pmempool_check_status *pmempool_check(PMEMpoolcheck *ppc); #else +WIN_DEPR_ATTR struct pmempool_check_statusU *pmempool_checkU(PMEMpoolcheck *ppc); +WIN_DEPR_ATTR struct pmempool_check_statusW *pmempool_checkW(PMEMpoolcheck *ppc); #endif @@ -238,7 +245,9 @@ struct pmempool_check_statusW *pmempool_checkW(PMEMpoolcheck *ppc); #ifndef _WIN32 int pmempool_sync(const char *poolset_file, unsigned flags); #else +WIN_DEPR_ATTR int pmempool_syncU(const char *poolset_file, unsigned flags); +WIN_DEPR_ATTR int pmempool_syncW(const wchar_t *poolset_file, unsigned flags); #endif @@ -251,8 +260,10 @@ int pmempool_syncW(const wchar_t *poolset_file, unsigned flags); int pmempool_transform(const char *poolset_file_src, const char *poolset_file_dst, unsigned flags); #else +WIN_DEPR_ATTR int pmempool_transformU(const char *poolset_file_src, const char *poolset_file_dst, unsigned flags); +WIN_DEPR_ATTR int pmempool_transformW(const wchar_t *poolset_file_src, const wchar_t *poolset_file_dst, unsigned flags); #endif @@ -274,8 +285,10 @@ enum pmempool_feature { int pmempool_feature_enable(const char *path, enum pmempool_feature feature, unsigned flags); #else +WIN_DEPR_ATTR int pmempool_feature_enableU(const char *path, enum pmempool_feature feature, unsigned flags); +WIN_DEPR_ATTR int pmempool_feature_enableW(const wchar_t *path, enum pmempool_feature feature, unsigned flags); #endif @@ -285,8 +298,10 @@ int pmempool_feature_enableW(const wchar_t *path, int pmempool_feature_disable(const char *path, enum pmempool_feature feature, unsigned flags); #else +WIN_DEPR_ATTR int pmempool_feature_disableU(const char *path, enum pmempool_feature feature, unsigned flags); +WIN_DEPR_ATTR int pmempool_feature_disableW(const wchar_t *path, enum pmempool_feature feature, unsigned flags); #endif @@ -296,8 +311,10 @@ int pmempool_feature_disableW(const wchar_t *path, int pmempool_feature_query(const char *path, enum pmempool_feature feature, unsigned flags); #else +WIN_DEPR_ATTR int pmempool_feature_queryU(const char *path, enum pmempool_feature feature, unsigned flags); +WIN_DEPR_ATTR int pmempool_feature_queryW(const wchar_t *path, enum pmempool_feature feature, unsigned flags); #endif @@ -306,7 +323,9 @@ int pmempool_feature_queryW(const wchar_t *path, #ifndef _WIN32 int pmempool_rm(const char *path, unsigned flags); #else +WIN_DEPR_ATTR int pmempool_rmU(const char *path, unsigned flags); +WIN_DEPR_ATTR int pmempool_rmW(const wchar_t *path, unsigned flags); #endif @@ -314,8 +333,10 @@ int pmempool_rmW(const wchar_t *path, unsigned flags); const char *pmempool_check_version(unsigned major_required, unsigned minor_required); #else +WIN_DEPR_ATTR const char *pmempool_check_versionU(unsigned major_required, unsigned minor_required); +WIN_DEPR_ATTR const wchar_t *pmempool_check_versionW(unsigned major_required, unsigned minor_required); #endif @@ -323,7 +344,9 @@ const wchar_t *pmempool_check_versionW(unsigned major_required, #ifndef _WIN32 const char *pmempool_errormsg(void); #else +WIN_DEPR_ATTR const char *pmempool_errormsgU(void); +WIN_DEPR_ATTR const wchar_t *pmempool_errormsgW(void); #endif diff --git a/src/test/log_recovery/log_recovery.vcxproj b/src/test/log_recovery/log_recovery.vcxproj index d8c98cd8092..2aed9778521 100644 --- a/src/test/log_recovery/log_recovery.vcxproj +++ b/src/test/log_recovery/log_recovery.vcxproj @@ -48,8 +48,7 @@ Disabled - - + 4996 $(SolutionDir)\libpmemlog;%(AdditionalIncludeDirectories) @@ -57,8 +56,7 @@ MaxSpeed - - + 4996 $(SolutionDir)\libpmemlog;%(AdditionalIncludeDirectories) diff --git a/src/test/obj_action/obj_action.vcxproj b/src/test/obj_action/obj_action.vcxproj index f1b64898fc0..07ecfeb6052 100644 --- a/src/test/obj_action/obj_action.vcxproj +++ b/src/test/obj_action/obj_action.vcxproj @@ -66,8 +66,7 @@ NotUsing Disabled - - + 4996 CompileAsCpp @@ -79,8 +78,7 @@ NotUsing MaxSpeed - - + 4996 stdafx.h CompileAsCpp diff --git a/src/test/obj_alloc/obj_alloc.vcxproj b/src/test/obj_alloc/obj_alloc.vcxproj index 235fc30b43e..04ac55e42a1 100644 --- a/src/test/obj_alloc/obj_alloc.vcxproj +++ b/src/test/obj_alloc/obj_alloc.vcxproj @@ -63,8 +63,7 @@ NotUsing Disabled - - + 4996 CompileAsCpp $(ProjectDir)\..\..\libpmemobj;%(AdditionalIncludeDirectories) @@ -77,8 +76,7 @@ NotUsing MaxSpeed - - + 4996 stdafx.h CompileAsCpp $(ProjectDir)\..\..\libpmemobj;%(AdditionalIncludeDirectories) diff --git a/src/test/obj_basic_integration/obj_basic_integration.vcxproj b/src/test/obj_basic_integration/obj_basic_integration.vcxproj index 2cd71b9d414..3ec079fc350 100644 --- a/src/test/obj_basic_integration/obj_basic_integration.vcxproj +++ b/src/test/obj_basic_integration/obj_basic_integration.vcxproj @@ -52,8 +52,7 @@ NotUsing Disabled - - + 4996 CompileAsCpp @@ -65,8 +64,7 @@ NotUsing MaxSpeed - - + 4996 stdafx.h CompileAsCpp diff --git a/src/test/obj_critnib/obj_critnib.vcxproj b/src/test/obj_critnib/obj_critnib.vcxproj index bcea386a155..6e3f87ac005 100644 --- a/src/test/obj_critnib/obj_critnib.vcxproj +++ b/src/test/obj_critnib/obj_critnib.vcxproj @@ -64,8 +64,7 @@ NotUsing Disabled - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) diff --git a/src/test/obj_critnib_mt/obj_critnib_mt.vcxproj b/src/test/obj_critnib_mt/obj_critnib_mt.vcxproj index e1eb1fd9af9..05fe3d2ca40 100644 --- a/src/test/obj_critnib_mt/obj_critnib_mt.vcxproj +++ b/src/test/obj_critnib_mt/obj_critnib_mt.vcxproj @@ -65,8 +65,7 @@ NotUsing Disabled - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) diff --git a/src/test/obj_direct/obj_direct.vcxproj b/src/test/obj_direct/obj_direct.vcxproj index 592ce3c782c..9f0fb46ff61 100644 --- a/src/test/obj_direct/obj_direct.vcxproj +++ b/src/test/obj_direct/obj_direct.vcxproj @@ -74,8 +74,7 @@ NotUsing Disabled - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) @@ -84,8 +83,7 @@ NotUsing MaxSpeed - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) diff --git a/src/test/obj_direct_volatile/obj_direct_volatile.vcxproj b/src/test/obj_direct_volatile/obj_direct_volatile.vcxproj index 92b27bd2722..1f33b2ec840 100644 --- a/src/test/obj_direct_volatile/obj_direct_volatile.vcxproj +++ b/src/test/obj_direct_volatile/obj_direct_volatile.vcxproj @@ -69,8 +69,7 @@ NotUsing Disabled - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) @@ -79,8 +78,7 @@ NotUsing MaxSpeed - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) diff --git a/src/test/obj_heap_reopen/obj_heap_reopen.vcxproj b/src/test/obj_heap_reopen/obj_heap_reopen.vcxproj index 54efe5f09ed..17bb9de9b1f 100644 --- a/src/test/obj_heap_reopen/obj_heap_reopen.vcxproj +++ b/src/test/obj_heap_reopen/obj_heap_reopen.vcxproj @@ -52,8 +52,7 @@ NotUsing Disabled - - + 4996 CompileAsCpp @@ -65,8 +64,7 @@ NotUsing MaxSpeed - - + 4996 stdafx.h CompileAsCpp diff --git a/src/test/obj_list/obj_list.vcxproj b/src/test/obj_list/obj_list.vcxproj index f2787cd1325..a5a7a216664 100644 --- a/src/test/obj_list/obj_list.vcxproj +++ b/src/test/obj_list/obj_list.vcxproj @@ -69,9 +69,9 @@ _DEBUG;_CONSOLE;%(PreprocessorDefinitions) NDEBUG;_CONSOLE;%(PreprocessorDefinitions) CompileAsCpp - 4065 + 4065;4996 CompileAsCpp - 4065 + 4065;4996 _DEBUG;_CONSOLE;%(PreprocessorDefinitions);WRAP_REAL_ULOG;WRAP_REAL_LANE;WRAP_REAL_HEAP;WRAP_REAL_PMEMOBJ diff --git a/src/test/obj_realloc/obj_realloc.vcxproj b/src/test/obj_realloc/obj_realloc.vcxproj index 313332574e1..e5870b8f867 100644 --- a/src/test/obj_realloc/obj_realloc.vcxproj +++ b/src/test/obj_realloc/obj_realloc.vcxproj @@ -49,7 +49,7 @@ Disabled false - 4200 + 4200;4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) CompileAsCpp @@ -58,7 +58,7 @@ MaxSpeed - 4200 + 4200;4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) CompileAsCpp diff --git a/src/test/obj_sync/obj_sync.vcxproj b/src/test/obj_sync/obj_sync.vcxproj index a05770e79bd..e894459cd3b 100644 --- a/src/test/obj_sync/obj_sync.vcxproj +++ b/src/test/obj_sync/obj_sync.vcxproj @@ -48,8 +48,7 @@ Disabled - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) mocks_windows.h;%(ForcedIncludeFiles) @@ -58,8 +57,7 @@ MaxSpeed - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) mocks_windows.h;%(ForcedIncludeFiles) diff --git a/src/test/obj_tx_add_range/obj_tx_add_range.vcxproj b/src/test/obj_tx_add_range/obj_tx_add_range.vcxproj index 3d1a14dec1f..5fb39d82b8b 100644 --- a/src/test/obj_tx_add_range/obj_tx_add_range.vcxproj +++ b/src/test/obj_tx_add_range/obj_tx_add_range.vcxproj @@ -54,7 +54,7 @@ CompileAsCpp $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) - 4200 + 4200;4996 @@ -63,7 +63,7 @@ CompileAsCpp $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) - 4200 + 4200;4996 diff --git a/src/test/obj_tx_add_range_direct/obj_tx_add_range_direct.vcxproj b/src/test/obj_tx_add_range_direct/obj_tx_add_range_direct.vcxproj index a8a52f2e8eb..6c5610857d7 100644 --- a/src/test/obj_tx_add_range_direct/obj_tx_add_range_direct.vcxproj +++ b/src/test/obj_tx_add_range_direct/obj_tx_add_range_direct.vcxproj @@ -52,7 +52,7 @@ Disabled CompileAsCpp $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) - 4200 + 4200;4996 @@ -62,7 +62,7 @@ CompileAsCpp $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) - 4200 + 4200;4996 diff --git a/src/test/obj_ulog_size/obj_ulog_size.vcxproj b/src/test/obj_ulog_size/obj_ulog_size.vcxproj index 6f166a7eba8..07870104529 100644 --- a/src/test/obj_ulog_size/obj_ulog_size.vcxproj +++ b/src/test/obj_ulog_size/obj_ulog_size.vcxproj @@ -49,7 +49,7 @@ Disabled false - 4200 + 4200;4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) CompileAsCpp @@ -58,7 +58,7 @@ MaxSpeed - 4200 + 4200;4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) CompileAsCpp diff --git a/src/test/pmem_deep_persist/pmem_deep_persist.vcxproj b/src/test/pmem_deep_persist/pmem_deep_persist.vcxproj index 925717b274c..ce9cbeea0c8 100644 --- a/src/test/pmem_deep_persist/pmem_deep_persist.vcxproj +++ b/src/test/pmem_deep_persist/pmem_deep_persist.vcxproj @@ -137,8 +137,7 @@ - - + 4996 $(SolutionDir)\libpmem2;$(SolutionDir)\libpmem;$(SolutionDir)\libpmem2\x86_64;%(AdditionalIncludeDirectories) diff --git a/src/test/pmem_has_auto_flush_win/pmem_has_auto_flush_win.vcxproj b/src/test/pmem_has_auto_flush_win/pmem_has_auto_flush_win.vcxproj index e175f9cc43e..feb334e08e2 100644 --- a/src/test/pmem_has_auto_flush_win/pmem_has_auto_flush_win.vcxproj +++ b/src/test/pmem_has_auto_flush_win/pmem_has_auto_flush_win.vcxproj @@ -51,8 +51,7 @@ $(SolutionDir)\libpmem2;$(SolutionDir)\libpmem;%(AdditionalIncludeDirectories) mocks_windows.h;%(ForcedIncludeFiles) SSE2_AVAILABLE=0;AVX_AVAILABLE=0;AVX512F_AVAILABLE=0;%(PreprocessorDefinitions) - - + 4996 diff --git a/src/test/pmem_map_file/pmem_map_file.vcxproj b/src/test/pmem_map_file/pmem_map_file.vcxproj index 99bcc308891..b8c5a3ae952 100644 --- a/src/test/pmem_map_file/pmem_map_file.vcxproj +++ b/src/test/pmem_map_file/pmem_map_file.vcxproj @@ -82,8 +82,7 @@ - - + 4996 mocks_windows.h;%(ForcedIncludeFiles) $(SolutionDir)\libpmem2;$(SolutionDir)\libpmem;$(SolutionDir)\libpmem2\x86_64;%(AdditionalIncludeDirectories) diff --git a/src/test/pmem_map_file_trunc/pmem_map_file_trunc.vcxproj b/src/test/pmem_map_file_trunc/pmem_map_file_trunc.vcxproj index 7b109913951..c994b77ae44 100644 --- a/src/test/pmem_map_file_trunc/pmem_map_file_trunc.vcxproj +++ b/src/test/pmem_map_file_trunc/pmem_map_file_trunc.vcxproj @@ -60,8 +60,7 @@ - - + 4996 diff --git a/src/test/pmem_map_file_win/pmem_map_file_win.vcxproj b/src/test/pmem_map_file_win/pmem_map_file_win.vcxproj index c8d7cbc0028..68ee22d088d 100644 --- a/src/test/pmem_map_file_win/pmem_map_file_win.vcxproj +++ b/src/test/pmem_map_file_win/pmem_map_file_win.vcxproj @@ -82,8 +82,7 @@ - - + 4996 mocks_windows.h;%(ForcedIncludeFiles) $(SolutionDir)\libpmem2;$(SolutionDir)\libpmem;$(SolutionDir)\libpmem2\x86_64;%(AdditionalIncludeDirectories) diff --git a/src/test/signal_handle/signal_handle.vcxproj b/src/test/signal_handle/signal_handle.vcxproj index 50a55764337..d21ba66c0e5 100644 --- a/src/test/signal_handle/signal_handle.vcxproj +++ b/src/test/signal_handle/signal_handle.vcxproj @@ -57,15 +57,13 @@ - - + 4996 - - + 4996 diff --git a/src/test/tools/pmemobjcli/pmemobjcli.vcxproj b/src/test/tools/pmemobjcli/pmemobjcli.vcxproj index 092ad91f738..0632eaec383 100644 --- a/src/test/tools/pmemobjcli/pmemobjcli.vcxproj +++ b/src/test/tools/pmemobjcli/pmemobjcli.vcxproj @@ -78,7 +78,7 @@ CompileAsCpp false false - 4200 + 4200;4996 Shlwapi.lib;%(AdditionalDependencies) @@ -98,7 +98,7 @@ platform.h false false - 4200 + 4200;4996 Shlwapi.lib;%(AdditionalDependencies) diff --git a/src/test/util_ctl/util_ctl.vcxproj b/src/test/util_ctl/util_ctl.vcxproj index 6a2ccec2431..20f0464ceaa 100644 --- a/src/test/util_ctl/util_ctl.vcxproj +++ b/src/test/util_ctl/util_ctl.vcxproj @@ -63,8 +63,7 @@ NotUsing Disabled - - + 4996 $(SolutionDir)\libpmemobj;%(AdditionalIncludeDirectories) diff --git a/src/tools/pmempool/check.h b/src/tools/pmempool/check.h index 93bd2a80c6e..41cc6304ccc 100644 --- a/src/tools/pmempool/check.h +++ b/src/tools/pmempool/check.h @@ -1,9 +1,20 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * check.h -- pmempool check command header file */ +#ifdef _WIN32 +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) +#endif + +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_check_func(const char *appname, int argc, char *argv[]); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_check_help(const char *appname); diff --git a/src/tools/pmempool/common.h b/src/tools/pmempool/common.h index 0824882dd0f..7cb9bb44b4f 100644 --- a/src/tools/pmempool/common.h +++ b/src/tools/pmempool/common.h @@ -30,6 +30,9 @@ /* XXX - modify Linux makefiles to generate srcversion.h and remove #ifdef */ #ifdef _WIN32 #include "srcversion.h" + +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) #endif #define COUNT_OF(x) (sizeof(x) / sizeof(0[x])) @@ -141,16 +144,40 @@ struct pool_set_file { bool fileio; }; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif struct pool_set_file *pool_set_file_open(const char *fname, int rdonly, int check); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pool_set_file_close(struct pool_set_file *file); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pool_set_file_read(struct pool_set_file *file, void *buff, size_t nbytes, uint64_t off); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pool_set_file_write(struct pool_set_file *file, void *buff, size_t nbytes, uint64_t off); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pool_set_file_set_replica(struct pool_set_file *file, size_t replica); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif size_t pool_set_file_nreplicas(struct pool_set_file *file); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void *pool_set_file_map(struct pool_set_file *file, uint64_t offset); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pool_set_file_persist(struct pool_set_file *file, const void *addr, size_t len); @@ -164,36 +191,114 @@ struct ranges { PMDK_LIST_HEAD(rangeshead, range) head; }; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem_pool_type_t pmem_pool_type_parse_hdr(const struct pool_hdr *hdrp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem_pool_type_t pmem_pool_type(const void *base_pool_addr); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_pool_checksum(const void *base_pool_addr); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem_pool_type_t pmem_pool_type_parse_str(const char *str); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif uint64_t pmem_pool_get_min_size(pmem_pool_type_t type); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmem_pool_parse_params(const char *fname, struct pmem_pool_params *paramsp, int check); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_poolset_map(const char *fname, struct pool_set **poolset, int rdonly); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif struct options *util_options_alloc(const struct option *options, size_t nopts, const struct option_requirement *req); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void util_options_free(struct options *opts); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_options_verify(const struct options *opts, pmem_pool_type_t type); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_options_getopt(int argc, char *argv[], const char *optstr, const struct options *opts); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif pmem_pool_type_t util_get_pool_type_second_page(const void *pool_base_addr); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_parse_mode(const char *str, mode_t *mode); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_parse_ranges(const char *str, struct ranges *rangesp, struct range entire); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_ranges_add(struct ranges *rangesp, struct range range); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void util_ranges_clear(struct ranges *rangesp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_ranges_contain(const struct ranges *rangesp, uint64_t n); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_ranges_empty(const struct ranges *rangesp); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_check_memory(const uint8_t *buff, size_t len, uint8_t val); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_parse_chunk_types(const char *str, uint64_t *types); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_parse_lane_sections(const char *str, uint64_t *types); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif char ask(char op, char *answers, char def_ans, const char *fmt, va_list ap); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif char ask_Yn(char op, const char *fmt, ...) FORMAT_PRINTF(2, 3); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif char ask_yN(char op, const char *fmt, ...) FORMAT_PRINTF(2, 3); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif unsigned util_heap_max_zone(size_t size); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int util_pool_clear_badblocks(const char *path, int create); static const struct range ENTIRE_UINT64 = { diff --git a/src/tools/pmempool/convert.h b/src/tools/pmempool/convert.h index f5206039093..60aa0213f71 100644 --- a/src/tools/pmempool/convert.h +++ b/src/tools/pmempool/convert.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * convert.h -- pmempool convert command header file @@ -7,5 +7,16 @@ #include +#ifdef _WIN32 +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) +#endif + +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_convert_func(const char *appname, int argc, char *argv[]); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_convert_help(const char *appname); diff --git a/src/tools/pmempool/create.h b/src/tools/pmempool/create.h index 21d083aa7ce..b02fbfde5e7 100644 --- a/src/tools/pmempool/create.h +++ b/src/tools/pmempool/create.h @@ -1,9 +1,20 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * create.h -- pmempool create command header file */ +#ifdef _WIN32 +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) +#endif + +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_create_func(const char *appname, int argc, char *argv[]); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_create_help(const char *appname); diff --git a/src/tools/pmempool/dump.h b/src/tools/pmempool/dump.h index 1b0e7040b1f..bd230436b8e 100644 --- a/src/tools/pmempool/dump.h +++ b/src/tools/pmempool/dump.h @@ -1,9 +1,20 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * dump.h -- pmempool dump command header file */ +#ifdef _WIN32 +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) +#endif + +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_dump_func(const char *appname, int argc, char *argv[]); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_dump_help(const char *appname); diff --git a/src/tools/pmempool/feature.h b/src/tools/pmempool/feature.h index 216f61d0f17..616c1de1024 100644 --- a/src/tools/pmempool/feature.h +++ b/src/tools/pmempool/feature.h @@ -1,9 +1,20 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2018-2020, Intel Corporation */ +/* Copyright 2018-2023, Intel Corporation */ /* * feature.h -- pmempool feature command header file */ +#ifdef _WIN32 +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) +#endif + +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_feature_func(const char *appname, int argc, char *argv[]); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_feature_help(const char *appname); diff --git a/src/tools/pmempool/info.h b/src/tools/pmempool/info.h index 77f1c81dc4b..65d17162781 100644 --- a/src/tools/pmempool/info.h +++ b/src/tools/pmempool/info.h @@ -12,6 +12,9 @@ #ifdef _WIN32 #define PMEMBLK_DEPR_ATTR __declspec(deprecated(BLK_DEPR_STR)) #define PMEMLOG_DEPR_ATTR __declspec(deprecated(LOG_DEPR_STR)) + +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) #else #define PMEMBLK_DEPR_ATTR __attribute__((deprecated(BLK_DEPR_STR))) #define PMEMLOG_DEPR_ATTR __attribute__((deprecated(LOG_DEPR_STR))) @@ -165,12 +168,24 @@ struct pmem_info { } obj; }; +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_info_func(const char *appname, int argc, char *argv[]); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_info_help(const char *appname); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_info_read(struct pmem_info *pip, void *buff, size_t nbytes, uint64_t off); PMEMBLK_DEPR_ATTR int pmempool_info_blk(struct pmem_info *pip); PMEMLOG_DEPR_ATTR int pmempool_info_log(struct pmem_info *pip); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_info_obj(struct pmem_info *pip); PMEMBLK_DEPR_ATTR int pmempool_info_btt(struct pmem_info *pip); diff --git a/src/tools/pmempool/output.h b/src/tools/pmempool/output.h index cd8194f2435..3fece56f695 100644 --- a/src/tools/pmempool/output.h +++ b/src/tools/pmempool/output.h @@ -12,44 +12,143 @@ #define BLK_DEPR_STR "Libpmemblk is deprecated." #ifdef _WIN32 #define PMEMBLK_DEPR_ATTR __declspec(deprecated(BLK_DEPR_STR)) + +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) #else #define PMEMBLK_DEPR_ATTR __attribute__((deprecated(BLK_DEPR_STR))) #endif +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void out_set_vlevel(int vlevel); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void out_set_stream(FILE *stream); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void out_set_prefix(const char *prefix); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void out_set_col_width(unsigned col_width); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void outv_err(const char *fmt, ...) FORMAT_PRINTF(1, 2); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void out_err(const char *file, int line, const char *func, const char *fmt, ...) FORMAT_PRINTF(4, 5); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void outv_err_vargs(const char *fmt, va_list ap); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void outv_indent(int vlevel, int i); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void outv(int vlevel, const char *fmt, ...) FORMAT_PRINTF(2, 3); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void outv_nl(int vlevel); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int outv_check(int vlevel); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void outv_title(int vlevel, const char *fmt, ...) FORMAT_PRINTF(2, 3); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void outv_field(int vlevel, const char *field, const char *fmt, ...) FORMAT_PRINTF(3, 4); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void outv_hexdump(int vlevel, const void *addr, size_t len, size_t offset, int sep); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_uuid_str(uuid_t uuid); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_time_str(time_t time); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_size_str(uint64_t size, int human); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_percentage(double percentage); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_checksum(void *addr, size_t len, uint64_t *csump, uint64_t skip_off); PMEMBLK_DEPR_ATTR const char *out_get_btt_map_entry(uint32_t map); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_pool_type_str(pmem_pool_type_t type); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_pool_signature(pmem_pool_type_t type); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_tx_state_str(uint64_t state); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_chunk_type_str(enum chunk_type type); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_chunk_flags(uint16_t flags); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_zone_magic_str(uint32_t magic); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_pmemoid_str(PMEMoid oid, uint64_t uuid_lo); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_arch_machine_class_str(uint8_t machine_class); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_arch_data_str(uint8_t data); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_arch_machine_str(uint16_t machine); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_last_shutdown_str(uint8_t dirty); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_alignment_desc_str(uint64_t ad, uint64_t cur_ad); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif const char *out_get_incompat_features_str(uint32_t incompat); diff --git a/src/tools/pmempool/rm.h b/src/tools/pmempool/rm.h index 51915741695..707f44bbca6 100644 --- a/src/tools/pmempool/rm.h +++ b/src/tools/pmempool/rm.h @@ -1,9 +1,20 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2020, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * rm.h -- pmempool rm command header file */ +#ifdef _WIN32 +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) +#endif + +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_rm_help(const char *appname); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_rm_func(const char *appname, int argc, char *argv[]); diff --git a/src/tools/pmempool/synchronize.h b/src/tools/pmempool/synchronize.h index 32c044de2a3..62fbf6262c1 100644 --- a/src/tools/pmempool/synchronize.h +++ b/src/tools/pmempool/synchronize.h @@ -1,9 +1,20 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2016-2020, Intel Corporation */ +/* Copyright 2016-2023, Intel Corporation */ /* * synchronize.h -- pmempool sync command header file */ +#ifdef _WIN32 +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) +#endif + +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_sync_func(const char *appname, int argc, char *argv[]); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_sync_help(const char *appname); diff --git a/src/tools/pmempool/transform.h b/src/tools/pmempool/transform.h index 6f0192fbd84..7f5be974332 100644 --- a/src/tools/pmempool/transform.h +++ b/src/tools/pmempool/transform.h @@ -1,9 +1,20 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2016-2020, Intel Corporation */ +/* Copyright 2016-2023, Intel Corporation */ /* * transform.h -- pmempool transform command header file */ +#ifdef _WIN32 +#define WIN_DEPR_STR "Windows support is deprecated." +#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR)) +#endif + +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif int pmempool_transform_func(const char *appname, int argc, char *argv[]); +#ifdef _WIN32 +WIN_DEPR_ATTR +#endif void pmempool_transform_help(const char *appname); diff --git a/src/windows/getopt/getopt.vcxproj b/src/windows/getopt/getopt.vcxproj index 679b74cb36c..ec883aa1ba4 100644 --- a/src/windows/getopt/getopt.vcxproj +++ b/src/windows/getopt/getopt.vcxproj @@ -50,7 +50,7 @@ CompileAsC true NTDDI_VERSION=NTDDI_WIN10_RS1;_DEBUG;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions) - 4819 + 4819;4996 true