mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Relocate Bstrncpyz to the bottom of compat.h so we can use our Bstrncpy macro there
git-svn-id: https://svn.eduke32.com/eduke32@3213 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d5fa8ade49
commit
f9ba5f827c
1 changed files with 7 additions and 7 deletions
|
@ -470,13 +470,6 @@ int32_t Bclosedir(BDIR *dir);
|
|||
typedef int32_t bssize_t;
|
||||
#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
|
||||
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
|
||||
|
@ -661,6 +654,13 @@ char *Bstrlwr(char *);
|
|||
char *Bstrupr(char *);
|
||||
#endif
|
||||
|
||||
static inline char *Bstrncpyz(char *dst, const char *src, bsize_t n)
|
||||
{
|
||||
Bstrncpy(dst, src, n);
|
||||
dst[n-1] = 0;
|
||||
return dst;
|
||||
}
|
||||
|
||||
#ifdef EXTERNC
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue