File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
9797 if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]" )
9898 string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} " )
9999 endif ()
100+
101+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_SPACED} " )
100102endif ()
101103
102104add_compile_options ("$<$<CONFIG:DEBUG>:-DDEBUG>" )
Original file line number Diff line number Diff line change 2929#
3030
3131set (WARNING_FLAGS
32+
33+ # possible loss of data
34+ /wd4244
35+
36+ # convert int to size_t
37+ /wd4267
3238)
Original file line number Diff line number Diff line change @@ -80,11 +80,17 @@ namespace vx {
8080 const auto nowAsTimeT = std::chrono::system_clock::to_time_t ( now );
8181 const auto nowMs = std::chrono::duration_cast<std::chrono::microseconds>( now.time_since_epoch () ) % 1000000 ;
8282
83+ #ifdef _WIN32
84+ localtime_s (¤tLocalTime, &nowAsTimeT);
85+ #else
86+ localtime_r (&nowAsTimeT, ¤tLocalTime);
87+ #endif
88+
8389 std::ostringstream nowSs;
8490 nowSs
85- << std::put_time ( localtime_r ( &nowAsTimeT, & currentLocalTime ) , " %Y-%m-%dT%T" )
91+ << std::put_time ( & currentLocalTime, " %Y-%m-%dT%T" )
8692 << ' .' << std::setfill ( ' 0' ) << std::setw ( 6 ) << nowMs.count ()
87- << std::put_time ( localtime_r ( &nowAsTimeT, & currentLocalTime ) , " %z" );
93+ << std::put_time ( & currentLocalTime, " %z" );
8894 std::string result = nowSs.str ();
8995 /* somewhat special - maybe see systemtimeformatter */
9096 result.replace ( result.end () - 2 , result.end () - 2 , " :" );
You can’t perform that action at this time.
0 commit comments