rcx

library of miscellaneous bits of C code
git clone git://git.rr3.xyz/rcx
Log | Files | Refs | README | LICENSE

commit f189dfbe6b6b7d55bb49018bb3d2b8ea83d58e25
parent 788f36ae124cfa1d4d005411ae8ea74d019cb75b
Author: robert <robertrussell.72001@gmail.com>
Date:   Fri, 19 Aug 2022 18:36:43 -0700

Add MIN and MAX macros for primitive C types

These should come from def.h for consistency, since def.h MIN and
MAX macros for fixed-sized types.

Most of these come for free from limits.h, but {,u}short requires
renaming.

Diffstat:
Minc/cext/def.h | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/inc/cext/def.h b/inc/cext/def.h @@ -1,5 +1,6 @@ #pragma once +#include <limits.h> #include <stddef.h> #include <stdint.h> @@ -20,6 +21,11 @@ #define unlikely(x) (x) #endif +/* Correct the mistakes of whoever named these macros */ +#define SHORT_MIN SHRT_MIN +#define SHORT_MAX SHRT_MAX +#define USHORT_MAX USHRT_MAX + typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint;