Skip to content

Commit d38d564

Browse files
committed
add C++20 module
1 parent 374292e commit d38d564

File tree

2 files changed

+52
-3
lines changed

2 files changed

+52
-3
lines changed

tinyxml.cppm

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
Original code by Lee Thomason (www.grinninglizard.com)
3+
4+
This software is provided 'as-is', without any express or implied
5+
warranty. In no event will the authors be held liable for any
6+
damages arising from the use of this software.
7+
8+
Permission is granted to anyone to use this software for any
9+
purpose, including commercial applications, and to alter it and
10+
redistribute it freely, subject to the following restrictions:
11+
12+
1. The origin of this software must not be misrepresented; you must
13+
not claim that you wrote the original software. If you use this
14+
software in a product, an acknowledgment in the product documentation
15+
would be appreciated but is not required.
16+
17+
2. Altered source versions must be plainly marked as such, and
18+
must not be misrepresented as being the original software.
19+
20+
3. This notice may not be removed or altered from any source
21+
distribution.
22+
*/
23+
24+
module;
25+
26+
#include <tinyxml2.h>
27+
28+
export module tinyxml2;
29+
30+
export inline constexpr auto TIXML2_MAJOR_VERSION = TIXML2_MAJOR_VERSION;
31+
export inline constexpr auto TIXML2_MINOR_VERSION = TIXML2_MINOR_VERSION;
32+
export inline constexpr auto TIXML2_PATCH_VERSION = TIXML2_PATCH_VERSION;
33+
34+
export namespace tinyxml2 {
35+
using tinyxml2::Whitespace;
36+
using tinyxml2::XMLAttribute;
37+
using tinyxml2::XMLComment;
38+
using tinyxml2::XMLConstHandle;
39+
using tinyxml2::XMLDeclaration;
40+
using tinyxml2::XMLDocument;
41+
using tinyxml2::XMLElement;
42+
using tinyxml2::XMLError;
43+
using tinyxml2::XMLHandle;
44+
using tinyxml2::XMLPrinter;
45+
using tinyxml2::XMLText;
46+
using tinyxml2::XMLUnknown;
47+
using tinyxml2::XMLUtil;
48+
using tinyxml2::XMLVisitor;
49+
} // namespace tibyxml2

tinyxml2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ distribution.
9696
/* Versioning, past 1.0.14:
9797
http://semver.org/
9898
*/
99-
static const int TIXML2_MAJOR_VERSION = 10;
100-
static const int TIXML2_MINOR_VERSION = 0;
101-
static const int TIXML2_PATCH_VERSION = 0;
99+
inline constexpr int TIXML2_MAJOR_VERSION = 10;
100+
inline constexpr int TIXML2_MINOR_VERSION = 0;
101+
inline constexpr int TIXML2_PATCH_VERSION = 0;
102102

103103
#define TINYXML2_MAJOR_VERSION 10
104104
#define TINYXML2_MINOR_VERSION 0

0 commit comments

Comments
 (0)