diff options
Diffstat (limited to 'src/core/common.h')
-rw-r--r-- | src/core/common.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/common.h b/src/core/common.h index 48b20884..c4c133fa 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -217,12 +217,13 @@ public: #if (defined(_MSC_VER)) extern int strcasecmp(const char *str1, const char *str2); +extern int strncasecmp(const char *str1, const char *str2, size_t len); #endif -extern wchar *AllocUnicode(const char*src); - #define clamp(v, low, high) ((v)<(low) ? (low) : (v)>(high) ? (high) : (v)) +#define clamp2(v, center, radius) ((v) < (center) ? Max(v, center - radius) : Min(v, center + radius)) + inline float sq(float x) { return x*x; } #define SQR(x) ((x) * (x)) @@ -446,4 +447,4 @@ inline T *WriteSaveBuf(uint8 *&buf, const T &value) assert(ReadSaveBuf<uint32>(buf) == size); -void cprintf(char*, ...); +void cprintf(char*, ...);
\ No newline at end of file |