Jan. 12, 2026
5:35 p.m.
* private.h (TWOS_COMPLEMENT): Port to signed-magnitude, which is still used on Unisys Clearpath MCP (a C90 platform). --- private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private.h b/private.h index 7e1e350a..42a1c892 100644 --- a/private.h +++ b/private.h @@ -943,7 +943,7 @@ ATTRIBUTE_PURE time_t time2posix_z(timezone_t, time_t); #define TYPE_BIT(type) (CHAR_BIT * (ptrdiff_t) sizeof(type)) #define TYPE_SIGNED(type) (((type) -1) < 0) -#define TWOS_COMPLEMENT(t) ((t) ~ (t) 0 < 0) +#define TWOS_COMPLEMENT(type) (TYPE_SIGNED (type) && (! ~ (type) -1)) /* Minimum and maximum of two values. Use lower case to avoid naming clashes with standard include files. */ -- 2.51.0