Skip to content

Commit b7c054c

Browse files
committed
Fix build VS2008 C++98
1 parent 697c286 commit b7c054c

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/Global.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ int Global::SQUASH[4096];
8383

8484
int Global::STRETCH[4096];
8585

86-
unordered_set<string> Global::WIN_RESERVED;
87-
86+
#if __cplusplus >= 201103L
87+
unordered_set<string> Global::WIN_RESERVED;
88+
#else
89+
set<string> Global::WIN_RESERVED;
90+
#endif
8891

8992
Global::Global()
9093
{
@@ -126,7 +129,12 @@ Global::Global()
126129
"LPT9", "NUL", "PRN"
127130
};
128131

132+
#if __cplusplus >= 201103L
129133
unordered_set<string> reserved_set(reserved, reserved + 27);
134+
#else
135+
set<string> reserved_set(reserved, reserved + 27);
136+
#endif
137+
130138
WIN_RESERVED = reserved_set;
131139
#endif
132140
}

src/Global.hpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ limitations under the License.
1717
#ifndef _Global_
1818
#define _Global_
1919

20-
#include <unordered_set>
20+
#if __cplusplus >= 201103L
21+
#include <unordered_set>
22+
#else
23+
#include <set>
24+
#endif
25+
2126
#include <string>
2227

2328
#include "types.hpp"
@@ -68,7 +73,11 @@ namespace kanzi {
6873
static char BASE64_SYMBOLS[];
6974
static char DNA_SYMBOLS[];
7075
static char NUMERIC_SYMBOLS[];
76+
#if __cplusplus >= 201103L
7177
static std::unordered_set<std::string> WIN_RESERVED;
78+
#else
79+
static std::set<std::string> WIN_RESERVED;
80+
#endif
7281
};
7382

7483

0 commit comments

Comments
 (0)