Skip to content

Commit

Permalink
refactor: remove detail::(local|gm)time_s from fwd
Browse files Browse the repository at this point in the history
  • Loading branch information
ToruNiina committed Jun 23, 2024
1 parent 7af0e66 commit 3c09d30
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
11 changes: 0 additions & 11 deletions include/toml11/fwd/datetime_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@
namespace toml
{

// To avoid non-threadsafe std::localtime. In C11 (not C++11!), localtime_s is
// provided in the absolutely same purpose, but C++11 is actually not compatible
// with C11. We need to dispatch the function depending on the OS.
namespace detail
{
std::tm localtime_s(const std::time_t* src);
std::tm gmtime_s(const std::time_t* src);
} // detail

// ----------------------------------------------------------------------------

enum class month_t : std::uint8_t
{
Jan = 0,
Expand Down
9 changes: 9 additions & 0 deletions tests/test_find.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
#include <string_view>
#endif

namespace toml
{
namespace detail
{
std::tm localtime_s(const std::time_t* src);
std::tm gmtime_s(const std::time_t* src);
} // detail
} // toml

TEST_CASE("testing toml::find with toml type")
{
using value_type = toml::value;
Expand Down
9 changes: 9 additions & 0 deletions tests/test_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
#include <string_view>
#endif

namespace toml
{
namespace detail
{
std::tm localtime_s(const std::time_t* src);
std::tm gmtime_s(const std::time_t* src);
} // detail
} // toml

TEST_CASE("testing toml::get with toml types")
{
using value_type = toml::value;
Expand Down

0 comments on commit 3c09d30

Please sign in to comment.