Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/time_zone_format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
// limitations under the License.

#if !defined(HAS_STRPTIME)
# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__VXWORKS__)
# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__VXWORKS__)
# define HAS_STRPTIME 0
# else
# define HAS_STRPTIME 1 // Assume everyone else has strptime().
# endif
#endif

#if defined(HAS_STRPTIME) && HAS_STRPTIME
#if HAS_STRPTIME
# if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
# define _XOPEN_SOURCE 500 // Exposes definitions for SUSv2 (UNIX 98).
# endif
Expand All @@ -39,7 +41,7 @@
#include <limits>
#include <string>
#include <vector>
#if !defined(HAS_STRPTIME)
#if !HAS_STRPTIME
#include <iomanip>
#include <sstream>
#endif
Expand All @@ -52,7 +54,7 @@ namespace detail {

namespace {

#if !defined(HAS_STRPTIME)
#if !HAS_STRPTIME
// Build a strptime() using C++11's std::get_time().
char* strptime(const char* s, const char* fmt, std::tm* tm) {
std::istringstream input(s);
Expand Down