Skip to content

Commit b11f47f

Browse files
committed
Fix windows build.
1 parent 436e9f5 commit b11f47f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/doomgeneric_ascii.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
#ifdef OS_WINDOWS
4242
#define CLK 0
43+
#define dg_random rand
4344

4445
#define WINDOWS_CALL(cond, format) \
4546
do { \
@@ -77,6 +78,7 @@ static int clock_gettime(const int p, struct timespec *const spec)
7778

7879
#else
7980
#define CLK CLOCK_REALTIME
81+
#define dg_random random
8082
#endif
8183

8284
#ifdef __GNUC__
@@ -356,8 +358,10 @@ void DG_DrawFrame(void)
356358
const char *const gradient = braille_grads[idx - 1];
357359
const size_t len =
358360
braille_grad_lengths[idx - 1] / 3;
359-
BUF_MEMCPY(buf, &gradient[(random() % len) * 3], 3);
360-
BUF_MEMCPY(buf, &gradient[(random() % len) * 3], 3);
361+
BUF_MEMCPY(
362+
buf, &gradient[(dg_random() % len) * 3], 3);
363+
BUF_MEMCPY(
364+
buf, &gradient[(dg_random() % len) * 3], 3);
361365
} else {
362366
BUF_PUTS(buf, " ");
363367
}

0 commit comments

Comments
 (0)