Skip to content

Commit 0f5b2e4

Browse files
committed
disable warning 5244 for std module
1 parent 1f3647d commit 0f5b2e4

File tree

2 files changed

+28
-33
lines changed

2 files changed

+28
-33
lines changed

src/pugixml.cppm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ import std.compat;
6464
#if defined(__clang__)
6565
# pragma clang diagnostic push
6666
# pragma clang diagnostic ignored "-Winclude-angled-in-module-purview"
67+
#elif defined(_MSC_VER)
68+
# pragma warning(push)
69+
# pragma warning(disable:5244)
6770
#endif
6871
#if !defined(PUGIXML_HEADER_ONLY)
6972
extern "C++" {
@@ -74,6 +77,8 @@ extern "C++" {
7477
#endif
7578
#if defined(__clang__)
7679
# pragma clang diagnostic pop
80+
#elif defined(_MSC_VER)
81+
# pragma warning(pop)
7782
#endif
7883

7984

src/pugixml.hpp

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,19 @@
2121
#ifndef HEADER_PUGIXML_HPP
2222
#define HEADER_PUGIXML_HPP
2323

24-
#ifndef PUGIXML_EXPORT_MODULE
2524
// Include stddef.h for size_t and ptrdiff_t
26-
# include <stddef.h>
25+
#include <stddef.h>
2726

2827
// Include exception header for XPath
29-
# if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS)
30-
# include <exception>
31-
# endif
28+
#if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS)
29+
# include <exception>
30+
#endif
3231

3332
// Include STL headers
34-
# ifndef PUGIXML_NO_STL
35-
# include <iterator>
36-
# include <iosfwd>
37-
# include <string>
38-
# endif
33+
#ifndef PUGIXML_NO_STL
34+
# include <iterator>
35+
# include <iosfwd>
36+
# include <string>
3937
#endif
4038

4139
// Check if std::string_view is available
@@ -48,10 +46,8 @@
4846
#endif
4947

5048
// Include string_view if appropriate
51-
#ifndef PUGIXML_EXPORT_MODULE
52-
# ifdef PUGIXML_HAS_STRING_VIEW
53-
# include <string_view>
54-
# endif
49+
#ifdef PUGIXML_HAS_STRING_VIEW
50+
# include <string_view>
5551
#endif
5652

5753
// Macro for deprecated features
@@ -138,27 +134,25 @@
138134
# endif
139135
#endif
140136

141-
#ifndef PUGIXML_CONSTEXPR11
137+
// If C++ is 2011 or higher, add 'constexpr' qualifiers
138+
#ifndef PUGIXML_CONSTEXPR
142139
# if __cplusplus >= 201103
143-
# define PUGIXML_CONSTEXPR11 constexpr
140+
# define PUGIXML_CONSTEXPR constexpr
144141
# elif defined(_MSC_VER) && _MSC_VER >= 1910
145-
# define PUGIXML_CONSTEXPR11 constexpr
142+
# define PUGIXML_CONSTEXPR constexpr
146143
# else
147-
# define PUGIXML_CONSTEXPR11
144+
# define PUGIXML_CONSTEXPR const
148145
# endif
149146
#endif
150147

151-
// If C++ is 2011 or higher, add 'constexpr' qualifiers to constants
152-
// If C++ is 2017 or higher, add 'inline' qualifiers to constants
153-
// inline constexpr is required for C++20 module
148+
// If C++ is 2017 or higher, add 'inline' qualifiers for constants
149+
// required for C++20 module
154150
#ifndef PUGIXML_CONSTANT
155-
# if __cplusplus >= 201703
156-
# define PUGIXML_CONSTANT inline PUGIXML_CONSTEXPR11
157-
# elif __cplusplus >= 201103
158-
# define PUGIXML_CONSTANT PUGIXML_CONSTEXPR11
159-
# else
160-
# define PUGIXML_CONSTANT const
161-
# endif
151+
# if __cplusplus >= 201703
152+
# define PUGIXML_CONSTANT inline PUGIXML_CONSTEXPR
153+
# else
154+
# define PUGIXML_CONSTANT PUGIXML_CONSTEXPR
155+
# endif
162156
#endif
163157

164158
// Character interface macros
@@ -170,10 +164,6 @@
170164
# define PUGIXML_CHAR char
171165
#endif
172166

173-
#ifndef PUGIXML_MODULE_EXPORT
174-
# define PUGIXML_MODULE_EXPORT
175-
#endif
176-
177167
namespace pugi
178168
{
179169
// Character type used for all internal storage and operations; depends on PUGIXML_WCHAR_MODE
@@ -191,7 +181,7 @@ namespace pugi
191181
}
192182

193183
// The PugiXML namespace
194-
PUGIXML_MODULE_EXPORT namespace pugi
184+
namespace pugi
195185
{
196186
// Tree node types
197187
enum xml_node_type

0 commit comments

Comments
 (0)