1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 04:54:28 +01:00

libtins now compiles on windows. A couple of features were disabled and need to be fixed though.

This commit is contained in:
Matias Fontanini
2012-12-02 00:45:10 -03:00
parent dbe67c8cae
commit 6d1e96866e
11 changed files with 80 additions and 22 deletions

View File

@@ -42,6 +42,14 @@ namespace Tins {
*/
class Timestamp {
public:
#ifdef WIN32
typedef long seconds_type;
typedef long microseconds_type;
#else
typedef time_t seconds_type;
typedef suseconds_t microseconds_type;
#endif
/**
* Default constructs the timestamp.
*/
@@ -56,14 +64,14 @@ public:
/**
* Returns the amount of seconds in this timestamp.
*/
time_t seconds() const {
seconds_type seconds() const {
return tv.tv_sec;
}
/**
* Returns the amount of microseconds in this timestamp.
*/
suseconds_t microseconds() const {
microseconds_type microseconds() const {
return tv.tv_usec;
}