From f07d5d381ecf5c65e005b156f21f9ba01e136ec7 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 6 Jun 2025 00:19:23 +0200 Subject: [PATCH] fix the goddamn boolean --- src/doomtype.h | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/doomtype.h b/src/doomtype.h index 79806365d..ac41a4413 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -162,22 +162,19 @@ size_t strlcpy(char *dst, const char *src, size_t siz); /* Boolean type definition */ -// \note __BYTEBOOL__ used to be set above if "macintosh" was defined, -// if macintosh's version of boolean type isn't needed anymore, then isn't this macro pointless now? -#ifndef __BYTEBOOL__ - #define __BYTEBOOL__ - - //faB: clean that up !! - #if defined( _MSC_VER) && (_MSC_VER >= 1800) // MSVC 2013 and forward - #include "stdbool.h" - #elif defined (_WIN32) - #define false FALSE // use windows types - #define true TRUE - #define boolean BOOL - #else - typedef enum {false, true} boolean; - #endif -#endif // __BYTEBOOL__ +#ifndef _WIN32 +#include +// dont use stdbools _BOOL type +// its smaller (1 byte) than the old interger bool (4 bytes) +// which results in packed struct sizes being mismatched between vanilla and this +// however we gotta still include stdbool cause since c23 true and false are keywords +// which we cant use as enumeration constants +typedef int32_t boolean; +#else +#define false FALSE +#define true TRUE +#define boolean BOOL +#endif /* 7.18.2.1 Limits of exact-width integer types */ #ifndef INT8_MIN