Skip to content

Commit

Permalink
Make it compile for VC++
Browse files Browse the repository at this point in the history
  • Loading branch information
skyline75489 authored and emilk committed May 21, 2017
1 parent 16de358 commit 6a703a5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions configuru.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,15 @@ www.github.com/emilk/configuru
CONFIGURU_ONERROR(message_str)
#endif // CONFIGURU_ON_DANGLING

#ifdef __GNUC__
#define CONFIGURU_NORETURN __attribute__((noreturn))
#elif __MINGW32__
#define CONFIGURU_NORETURN __attribute__((noreturn))
#elif __clang__
#define CONFIGURU_NORETURN __attribute__((noreturn))
#elif _MSC_VER
#define CONFIGURU_NORETURN
#endif

#ifndef CONFIGURU_IMPLICIT_CONVERSIONS
/// Set to 1 to allow `int x = some_cfg,`
Expand All @@ -101,8 +109,6 @@ www.github.com/emilk/configuru
#define CONFIGURU_VALUE_SEMANTICS 0
#endif

#define CONFIGURU_NORETURN __attribute__((noreturn))

#undef Bool // Needed on Ubuntu 14.04 with GCC 4.8.5
#undef check // Needed on OSX

Expand Down Expand Up @@ -2884,7 +2890,7 @@ namespace configuru
_ptr += 1;
uint64_t codepoint = parse_hex(4);

if (0xD800 <= codepoint and codepoint <= 0xDBFF)
if (0xD800 <= codepoint && codepoint <= 0xDBFF)
{
// surrogate pair
parse_assert(_ptr[0] == '\\' && _ptr[1] == 'u',
Expand Down Expand Up @@ -3272,7 +3278,7 @@ namespace configuru
for (auto it=object.begin(); it!=object.end(); ++it) {
pairs.push_back(it);
if (align_values) {
longest_key = std::max(longest_key, it->first.size());
longest_key = (std::max)(longest_key, it->first.size());
}
}

Expand Down

0 comments on commit 6a703a5

Please sign in to comment.