|
|
@ -46,20 +46,6 @@ static const int64_t CENT = 1000000; |
|
|
|
// This is needed because the foreach macro can't get over the comma in pair<t1, t2>
|
|
|
|
// This is needed because the foreach macro can't get over the comma in pair<t1, t2>
|
|
|
|
#define PAIRTYPE(t1, t2) std::pair<t1, t2> |
|
|
|
#define PAIRTYPE(t1, t2) std::pair<t1, t2> |
|
|
|
|
|
|
|
|
|
|
|
// Align by increasing pointer, must have extra space at end of buffer
|
|
|
|
|
|
|
|
template <size_t nBytes, typename T> |
|
|
|
|
|
|
|
T* alignup(T* p) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
union |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
T* ptr; |
|
|
|
|
|
|
|
size_t n; |
|
|
|
|
|
|
|
} u; |
|
|
|
|
|
|
|
u.ptr = p; |
|
|
|
|
|
|
|
u.n = (u.n + (nBytes-1)) & ~(nBytes-1); |
|
|
|
|
|
|
|
return u.ptr; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WIN32 |
|
|
|
#ifdef WIN32 |
|
|
|
#define MSG_DONTWAIT 0 |
|
|
|
#define MSG_DONTWAIT 0 |
|
|
|
|
|
|
|
|
|
|
|