mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
Add "static inline" helper function "Bstrncpyz" to compat.h.
git-svn-id: https://svn.eduke32.com/eduke32@2550 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e7f091cd90
commit
e350502cd0
1 changed files with 7 additions and 0 deletions
|
@ -431,6 +431,13 @@ int32_t Bclosedir(BDIR *dir);
|
||||||
typedef int32_t bssize_t;
|
typedef int32_t bssize_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline char *Bstrncpyz(char *dst, const char *src, bsize_t n)
|
||||||
|
{
|
||||||
|
strncpy(dst, src, n);
|
||||||
|
dst[n-1] = 0;
|
||||||
|
return dst;
|
||||||
|
}
|
||||||
|
|
||||||
#if RAND_MAX == 32767
|
#if RAND_MAX == 32767
|
||||||
static inline uint16_t system_15bit_rand(void) { return (uint16_t)rand(); }
|
static inline uint16_t system_15bit_rand(void) { return (uint16_t)rand(); }
|
||||||
#else // RAND_MAX > 32767, assumed to be of the form 2^k - 1
|
#else // RAND_MAX > 32767, assumed to be of the form 2^k - 1
|
||||||
|
|
Loading…
Reference in a new issue