+12
-0
lines changedFilter options
+12
-0
lines changed Original file line number Diff line number Diff line change
@@ -3,7 +3,13 @@
3
3
//
4
4
5
5
#include <cmath>
6
+
#if defined(__unix__)
7
+
#include <time.h>
8
+
#elif defined(_WIN32)
9
+
#include <time.h>
10
+
#else
6
11
#include <ctime>
12
+
#endif
7
13
#include <matplot/core/axes_type.h>
8
14
#include <matplot/core/axis_type.h>
9
15
#include <matplot/core/figure_type.h>
@@ -257,7 +263,13 @@ namespace matplot {
257
263
char buff[20] = {0};
258
264
time_t now = (time_t)tick_values_[i];
259
265
struct tm buf;
266
+
#if defined(__unix__)
267
+
localtime_r(&now, &buf);
268
+
#elif defined(_WIN32)
260
269
localtime_s(&buf, &now);
270
+
#else
271
+
buf = *std::localtime(&now);
272
+
#endif
261
273
strftime(buff, 20, tick_label_format_.c_str(), &buf);
262
274
r += "\"" + escape(std::string(buff)) + "\" ";
263
275
} else {
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4