Skip to content
Extraits de code Groupes Projets
Valider 37b904b7 rédigé par Amar Takhar's avatar Amar Takhar
Parcourir les fichiers

Create time_log() to return a timeval so I can implement this on windows as well.

Originally committed to SVN as r4391.
parent ac42fcda
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -25,6 +25,7 @@
#include "libaegisub/log.h"
#include "libaegisub/mutex.h"
#include "libaegisub/util.h"
namespace agi {
namespace log {
......@@ -129,7 +130,7 @@ Message::Message(const char *section,
buf = new char[len];
msg = new std::ostrstream(buf, len);
timeval tv;
gettimeofday(&tv, (struct timezone *)NULL);
util::time_log(tv);
sm = new SinkMessage(section, severity, file, func, line, tv);
}
......
......@@ -19,6 +19,13 @@
/// @ingroup libaegisub
#ifndef LAGI_PRE
#include <stdio.h>
#ifdef _WIN32
# include <time.h>
#else
# include <sys/time.h>
#endif // _WIN32
#include <deque>
#ifdef __DEPRECATED // Dodge GCC warnings
# undef __DEPRECATED
......
......@@ -21,7 +21,12 @@
#ifndef LAGI_PRE
#include <string>
#include <stdio.h>
#endif
#ifdef _WIN32
# include <time.h>
#else
# include <sys/time.h>
#endif // _WIN32
#endif // LAGI_PRE
#include <libaegisub/access.h>
......@@ -30,7 +35,7 @@ namespace agi {
const std::string DirName(const std::string& path);
void Rename(const std::string& from, const std::string& to);
void time_log(timeval &tv);
} // namespace util
} // namespace agi
......@@ -55,5 +55,9 @@ void Rename(const std::string& from, const std::string& to) {
rename(from.c_str(), to.c_str());
}
void time_log(timeval &tv) {
gettimeofday(&tv, (struct timezone *)NULL);
}
} // namespace io
} // namespace agi
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter