1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 04:34:27 +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

@@ -43,7 +43,11 @@
#define TINS_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)
#define TINS_IS_BIG_ENDIAN (_BYTE_ORDER == _BIG_ENDIAN)
#endif
#elif !defined(WIN32)
#elif defined(WIN32)
// Assume windows == little endian. fixme later
#define TINS_IS_LITTLE_ENDIAN 1
#define TINS_IS_BIG_ENDIAN 0
#else
#include <endian.h>
#define TINS_IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN)
#define TINS_IS_BIG_ENDIAN (__BYTE_ORDER == __BIG_ENDIAN)

View File

@@ -124,10 +124,12 @@ namespace Tins {
/* Setters */
#ifndef WIN32
/**
* \sa PDU::send()
*/
void send(PacketSender &sender);
#endif
/**
* \brief Setter for the version field.

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;
}