summary refs log tree commit diff
diff options
context:
space:
mode:
authorLain Iwakura <lain@lainmail.xyz>2026-01-04 14:13:19 +0300
committerLain Iwakura <lain@lainmail.xyz>2026-01-04 14:13:19 +0300
commit3d595a6b073a6b1388bd7c420ab259566ba04afe (patch)
tree957ad085d8c4e2561245871a590f0aa897d21b37
parentfeat(linux): some patches (diff)
downloadplay-3d595a6b073a6b1388bd7c420ab259566ba04afe.tar.gz
play-3d595a6b073a6b1388bd7c420ab259566ba04afe.zip
feat(linux): some patches
-rw-r--r--2048.c6
-rw-r--r--freecell.c6
-rw-r--r--snake.c6
3 files changed, 15 insertions, 3 deletions
diff --git a/2048.c b/2048.c
index b042ee0..2eb323e 100644
--- a/2048.c
+++ b/2048.c
@@ -22,11 +22,15 @@
 
 typedef unsigned uint;
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && (!defined(__GLIBC__) || !__GLIBC_PREREQ(2, 36))
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+#include <features.h>
+#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 36)
+#else
 static uint arc4random_uniform(uint upper_bound) {
 	return rand() % upper_bound;
 }
 #endif
+#endif
 
 static uint score;
 static uint grid[4][4];
diff --git a/freecell.c b/freecell.c
index c543bda..53b9712 100644
--- a/freecell.c
+++ b/freecell.c
@@ -30,11 +30,15 @@
 
 typedef unsigned uint;
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && (!defined(__GLIBC__) || !__GLIBC_PREREQ(2, 36))
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+#include <features.h>
+#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 36)
+#else
 static uint arc4random_uniform(uint upper_bound) {
 	return rand() % upper_bound;
 }
 #endif
+#endif
 typedef unsigned char byte;
 
 typedef byte Card;
diff --git a/snake.c b/snake.c
index 06ec230..5e1c103 100644
--- a/snake.c
+++ b/snake.c
@@ -27,11 +27,15 @@
 
 typedef unsigned uint;
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && (!defined(__GLIBC__) || !__GLIBC_PREREQ(2, 36))
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+#include <features.h>
+#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 36)
+#else
 static uint arc4random_uniform(uint upper_bound) {
 	return rand() % upper_bound;
 }
 #endif
+#endif
 typedef unsigned char byte;
 
 enum {