forked from 0ad/0ad
detect: add posix.h so _SC_* defines are visible (enables mem detect)
in several files, expand one-line function bodies (hard to debug) This was SVN commit r2066.
This commit is contained in:
parent
bfe7c1b491
commit
f777979cc8
@ -23,6 +23,7 @@
|
||||
#include "precompiled.h"
|
||||
|
||||
#include "lib.h"
|
||||
#include "posix.h"
|
||||
#include "detect.h"
|
||||
#include "timer.h"
|
||||
|
||||
|
@ -224,8 +224,14 @@ struct Alloc
|
||||
uint break_on_free : 1;
|
||||
uint break_on_realloc : 1;
|
||||
|
||||
void* user_p() const { return (char*)p + padding_size; }
|
||||
size_t user_size() const { return size - padding_size*2; }
|
||||
void* user_p() const
|
||||
{
|
||||
return (char*)p + padding_size;
|
||||
}
|
||||
size_t user_size() const
|
||||
{
|
||||
return size - padding_size*2;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -294,7 +294,9 @@ typedef DirEnts::const_iterator DirEntCIt;
|
||||
typedef DirEnts::reverse_iterator DirEntRIt;
|
||||
|
||||
static bool dirent_less(const DirEnt* d1, const DirEnt* d2)
|
||||
{ return d1->name.compare(d2->name) < 0; }
|
||||
{
|
||||
return d1->name.compare(d2->name) < 0;
|
||||
}
|
||||
|
||||
|
||||
// call <cb> for each file and subdirectory in <dir> (alphabetical order),
|
||||
|
@ -75,12 +75,16 @@ cassert(IDX_BITS + TAG_BITS <= sizeof(Handle)*CHAR_BIT);
|
||||
// return the handle's index field (always non-negative).
|
||||
// no error checking!
|
||||
static inline u32 h_idx(const Handle h)
|
||||
{ return (u32)((h >> IDX_SHIFT) & IDX_MASK) - 1; }
|
||||
{
|
||||
return (u32)((h >> IDX_SHIFT) & IDX_MASK) - 1;
|
||||
}
|
||||
|
||||
// return the handle's tag field.
|
||||
// no error checking!
|
||||
static inline u32 h_tag(const Handle h)
|
||||
{ return (u32)((h >> TAG_SHIFT) & TAG_MASK); }
|
||||
{
|
||||
return (u32)((h >> TAG_SHIFT) & TAG_MASK);
|
||||
}
|
||||
|
||||
// build a handle from index and tag.
|
||||
// can't fail.
|
||||
|
@ -140,8 +140,14 @@ static const long _1e7 = 10000000;
|
||||
static const i64 _1e9 = 1000000000;
|
||||
|
||||
|
||||
static inline void lock(void) { win_lock(HRT_CS); }
|
||||
static inline void unlock(void) { win_unlock(HRT_CS); }
|
||||
static inline void lock(void)
|
||||
{
|
||||
win_lock(HRT_CS);
|
||||
}
|
||||
static inline void unlock(void)
|
||||
{
|
||||
win_unlock(HRT_CS);
|
||||
}
|
||||
|
||||
|
||||
// decide upon a HRT implementation, checking if we can work around
|
||||
|
Loading…
Reference in New Issue
Block a user