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:
@@ -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)
|
||||
|
||||
@@ -124,10 +124,12 @@ namespace Tins {
|
||||
|
||||
/* Setters */
|
||||
|
||||
#ifndef WIN32
|
||||
/**
|
||||
* \sa PDU::send()
|
||||
*/
|
||||
void send(PacketSender &sender);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Setter for the version field.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user