gentoo-ebuilds/app-misc/bfr/files/bfr-1.6-bools.patch
NHOrus 4b45d6b26e
app-misc/bfr: Fix build issues on musl, with modern C
Corrects bool, adds missing include

Closes: https://bugs.gentoo.org/942415
Closes: https://bugs.gentoo.org/944302
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40696
Signed-off-by: Sam James <sam@gentoo.org>
2025-02-22 23:47:23 +00:00

29 lines
732 B
Diff

Uses bools for enabling/disabling debug.
Switch from self-defined to system version.
https://bugs.gentoo.org/944302
--- a/bfr.h
+++ b/bfr.h
@@ -9,6 +9,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#include <stdbool.h>
#ifdef BUFPLAY
#include <sys/mman.h>
#endif
@@ -17,14 +18,13 @@
# include "config.h"
#endif
-typedef enum {false, true} logical;
typedef enum { IN, RO, BF, WO, RW } state;
#ifndef DEBUG
# define debug(args...)
#else
# define debug(args...) if(dodebug==true) { fprintf(stderr, ## args); }
-logical dodebug;
+bool dodebug;
#endif
#define verbose(args...) if(verbose >= 1) { fprintf(stderr, ## args); }
#define vverbose(args...) if(verbose >= 2) { fprintf(stderr, ## args); }