Skip to content

Commit 61fe90f

Browse files
committed
Merge pull request #205 from nlohmann/issue204
replaced ssize_t occurrences with auto (fixes #204)
2 parents 1cc4717 + a831c78 commit 61fe90f

2 files changed

Lines changed: 6 additions & 32 deletions

File tree

src/json.hpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,12 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
3434
#include <utility>
3535
#include <vector>
3636

37-
// enable ssize_t on MinGW
38-
#ifdef __GNUC__
39-
#ifdef __MINGW32__
40-
#include <sys/types.h>
41-
#endif
42-
#endif
43-
4437
// disable float-equal warnings on GCC/clang
4538
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
4639
#pragma GCC diagnostic push
4740
#pragma GCC diagnostic ignored "-Wfloat-equal"
4841
#endif
4942

50-
// enable ssize_t for MSVC
51-
#ifdef _MSC_VER
52-
#include <basetsd.h>
53-
using ssize_t = SSIZE_T;
54-
#endif
55-
5643
/*!
5744
@brief namespace for Niels Lohmann
5845
@see https://github.com/nlohmann
@@ -7983,9 +7970,9 @@ class basic_json
79837970
return;
79847971
}
79857972

7986-
const ssize_t offset_start = m_start - m_content;
7987-
const ssize_t offset_marker = m_marker - m_start;
7988-
const ssize_t offset_cursor = m_cursor - m_start;
7973+
const auto offset_start = m_start - m_content;
7974+
const auto offset_marker = m_marker - m_start;
7975+
const auto offset_cursor = m_cursor - m_start;
79897976

79907977
m_buffer.erase(0, static_cast<size_t>(offset_start));
79917978
std::string line;

src/json.hpp.re2c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,12 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
3434
#include <utility>
3535
#include <vector>
3636

37-
// enable ssize_t on MinGW
38-
#ifdef __GNUC__
39-
#ifdef __MINGW32__
40-
#include <sys/types.h>
41-
#endif
42-
#endif
43-
4437
// disable float-equal warnings on GCC/clang
4538
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
4639
#pragma GCC diagnostic push
4740
#pragma GCC diagnostic ignored "-Wfloat-equal"
4841
#endif
4942

50-
// enable ssize_t for MSVC
51-
#ifdef _MSC_VER
52-
#include <basetsd.h>
53-
using ssize_t = SSIZE_T;
54-
#endif
55-
5643
/*!
5744
@brief namespace for Niels Lohmann
5845
@see https://github.com/nlohmann
@@ -7293,9 +7280,9 @@ class basic_json
72937280
return;
72947281
}
72957282

7296-
const ssize_t offset_start = m_start - m_content;
7297-
const ssize_t offset_marker = m_marker - m_start;
7298-
const ssize_t offset_cursor = m_cursor - m_start;
7283+
const auto offset_start = m_start - m_content;
7284+
const auto offset_marker = m_marker - m_start;
7285+
const auto offset_cursor = m_cursor - m_start;
72997286

73007287
m_buffer.erase(0, static_cast<size_t>(offset_start));
73017288
std::string line;

0 commit comments

Comments
 (0)