Skip to content

Commit 0a3489d

Browse files
authored
Removed individual warning suppressions in each file for C4251 [HZ-5297] (#1387)
Removed individual warning suppressions in each file for C4251 dll export warning in wondows and put a global suppression in Cmake file to suppress it for the project wide. It is OK to disable this warning project wise, because it means warnings about unexported fields such as std::vector in a class but it is not important because our users will compile from source code and hence they will always use the same e.g. `std::vector` versions. This makes less code lines for the project and remove the unneeded repetitions.
1 parent a55443d commit 0a3489d

File tree

193 files changed

+3
-1633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+3
-1633
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
158158
# MSVC-specific compiler flags
159159
if (MSVC)
160160
target_compile_options(${PROJECT_NAME} PRIVATE /bigobj)
161+
# suppress warning about DLL-interface dll export, users do import but we export in library.
162+
target_compile_options(${PROJECT_NAME} PRIVATE /wd4251 /wd4275)
161163
endif ()
162164

163165
# AppleClang-specific compiler flags, we set for all targets since we want these flags also for tests and examples

hazelcast/include/hazelcast/client/address.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
#include <string>
2323
#include <iosfwd>
2424

25-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
26-
#pragma warning(push)
27-
#pragma warning(disable : 4251) // for dll export
28-
#endif
29-
3025
namespace hazelcast {
3126
namespace client {
3227

@@ -118,7 +113,3 @@ struct HAZELCAST_API hash<hazelcast::client::address>
118113
const hazelcast::client::address& address) const noexcept;
119114
};
120115
} // namespace std
121-
122-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
123-
#pragma warning(pop)
124-
#endif

hazelcast/include/hazelcast/client/aws/aws_client.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
#include "hazelcast/util/export.h"
2222
#include "hazelcast/client/address.h"
2323

24-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
25-
#pragma warning(push)
26-
#pragma warning(disable : 4251) // for dll export
27-
#endif
28-
2924
namespace hazelcast {
3025
class logger;
3126

@@ -57,7 +52,3 @@ class HAZELCAST_API aws_client
5752
} // namespace aws
5853
} // namespace client
5954
} // namespace hazelcast
60-
61-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
62-
#pragma warning(pop)
63-
#endif

hazelcast/include/hazelcast/client/aws/impl/Constants.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717

1818
#include "hazelcast/util/export.h"
1919

20-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
21-
#pragma warning(push)
22-
#pragma warning(disable : 4251) // for dll export
23-
#endif
24-
2520
namespace hazelcast {
2621
namespace client {
2722
namespace aws {
@@ -38,7 +33,3 @@ struct HAZELCAST_API Constants
3833
} // namespace aws
3934
} // namespace client
4035
} // namespace hazelcast
41-
42-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
43-
#pragma warning(pop)
44-
#endif

hazelcast/include/hazelcast/client/aws/impl/DescribeInstances.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
#include "hazelcast/client/aws/security/ec2_request_signer.h"
2424
#include "hazelcast/util/SyncHttpsClient.h"
2525

26-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
27-
#pragma warning(push)
28-
#pragma warning(disable : 4251) // for dll export
29-
#endif
30-
3126
namespace hazelcast {
3227
class logger;
3328

@@ -97,7 +92,3 @@ class HAZELCAST_API DescribeInstances
9792
} // namespace aws
9893
} // namespace client
9994
} // namespace hazelcast
100-
101-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
102-
#pragma warning(pop)
103-
#endif

hazelcast/include/hazelcast/client/aws/impl/Filter.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020

2121
#include "hazelcast/util/export.h"
2222

23-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
24-
#pragma warning(push)
25-
#pragma warning(disable : 4251) // for dll export
26-
#endif
27-
2823
namespace hazelcast {
2924
namespace client {
3025
namespace aws {
@@ -56,7 +51,3 @@ class HAZELCAST_API Filter
5651
} // namespace aws
5752
} // namespace client
5853
} // namespace hazelcast
59-
60-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
61-
#pragma warning(pop)
62-
#endif

hazelcast/include/hazelcast/client/aws/security/ec2_request_signer.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121

2222
#include "hazelcast/util/export.h"
2323

24-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
25-
#pragma warning(push)
26-
#pragma warning(disable : 4251) // for dll export
27-
#endif
28-
2924
namespace hazelcast {
3025
namespace client {
3126
namespace config {
@@ -117,7 +112,3 @@ class HAZELCAST_API ec2_request_signer
117112
} // namespace aws
118113
} // namespace client
119114
} // namespace hazelcast
120-
121-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
122-
#pragma warning(pop)
123-
#endif

hazelcast/include/hazelcast/client/aws/utility/aws_url_encoder.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919

2020
#include "hazelcast/util/export.h"
2121

22-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
23-
#pragma warning(push)
24-
#pragma warning(disable : 4251) // for dll export
25-
#endif
26-
2722
namespace hazelcast {
2823
namespace client {
2924
namespace aws {
@@ -40,7 +35,3 @@ class HAZELCAST_API aws_url_encoder
4035
} // namespace aws
4136
} // namespace client
4237
} // namespace hazelcast
43-
44-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
45-
#pragma warning(pop)
46-
#endif

hazelcast/include/hazelcast/client/aws/utility/cloud_utility.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121

2222
#include "hazelcast/util/export.h"
2323

24-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
25-
#pragma warning(push)
26-
#pragma warning(disable : 4251) // for dll export
27-
#endif
28-
2924
namespace pt = boost::property_tree;
3025

3126
namespace hazelcast {
@@ -64,7 +59,3 @@ class HAZELCAST_API cloud_utility
6459
} // namespace aws
6560
} // namespace client
6661
} // namespace hazelcast
67-
68-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
69-
#pragma warning(pop)
70-
#endif

hazelcast/include/hazelcast/client/big_decimal.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
#include <boost/multiprecision/cpp_int.hpp>
2020
#include "hazelcast/util/export.h"
2121

22-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
23-
#pragma warning(push)
24-
#pragma warning(disable : 4251) // for dll export
25-
#endif
26-
2722
namespace hazelcast {
2823
namespace client {
2924
/**
@@ -102,6 +97,3 @@ to_bytes(const boost::multiprecision::cpp_int& i);
10297
} // namespace pimpl
10398
} // namespace client
10499
} // namespace hazelcast
105-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
106-
#pragma warning(pop)
107-
#endif

0 commit comments

Comments
 (0)