mirror of
https://github.com/glest/glest-source.git
synced 2025-08-14 04:13:58 +02:00
- bug fixes for non C++x11 compilers for using chrono
This commit is contained in:
Submodule data/glest_game updated: ad32e03df8...bf04854ade
@@ -25,7 +25,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <chrono>
|
//#include <chrono>
|
||||||
#include "leak_dumper.h"
|
#include "leak_dumper.h"
|
||||||
|
|
||||||
#if (defined WIN32) && !(defined snprintf)
|
#if (defined WIN32) && !(defined snprintf)
|
||||||
@@ -91,7 +91,7 @@ public:
|
|||||||
virtual void ShellCommandOutput_CallbackEvent(string cmd,char *output,void *userdata) = 0;
|
virtual void ShellCommandOutput_CallbackEvent(string cmd,char *output,void *userdata) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::chrono::time_point<std::chrono::system_clock> system_time_point;
|
//typedef std::chrono::time_point<std::chrono::system_clock> system_time_point;
|
||||||
tm threadsafe_localtime(const time_t &time);
|
tm threadsafe_localtime(const time_t &time);
|
||||||
// extracting std::time_t from std:chrono for "now"
|
// extracting std::time_t from std:chrono for "now"
|
||||||
time_t systemtime_now();
|
time_t systemtime_now();
|
||||||
|
@@ -31,6 +31,12 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if __cplusplus > 199711L
|
||||||
|
#include <chrono>
|
||||||
|
#else
|
||||||
|
#include <time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define S_ISDIR(mode) (((mode) & _S_IFDIR) == _S_IFDIR)
|
#define S_ISDIR(mode) (((mode) & _S_IFDIR) == _S_IFDIR)
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
@@ -117,8 +123,12 @@ tm threadsafe_localtime(const time_t &time) {
|
|||||||
|
|
||||||
// extracting std::time_t from std:chrono for "now"
|
// extracting std::time_t from std:chrono for "now"
|
||||||
time_t systemtime_now() {
|
time_t systemtime_now() {
|
||||||
|
#if __cplusplus > 199711L
|
||||||
system_time_point system_now = std::chrono::system_clock::now();
|
system_time_point system_now = std::chrono::system_clock::now();
|
||||||
return std::chrono::system_clock::to_time_t(system_now);
|
return std::chrono::system_clock::to_time_t(system_now);
|
||||||
|
#else
|
||||||
|
return time(NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user