From: Matthew Fernandez Date: Sat, 8 Jan 2022 01:40:03 +0000 (-0800) Subject: API BREAK: remove local 'INT_MAX' and 'INT_MIN' definitions X-Git-Tag: 3.0.0~83^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a97289990430d5c9b2b4966b91e28a27eade719d;p=graphviz API BREAK: remove local 'INT_MAX' and 'INT_MIN' definitions These constants are defined in ISO C to be available in limits.h, but were commonly available pre-ISO C too. These definitions remained here for legacy reasons, because removing them was considered an API break and not worth doing for this minor clean up. However the upcoming release is projected to involve a major version number bump. --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fd3a4371..28c3b02d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Breaking**: Using Graphviz as a library on Windows now requires the `GVDLL` symbol to be set to ensure correct linking. +- **Breaking**: Graphviz headers no longer (re-)define the C constants `INT_MIN` + and `INT_MAX`. Replacements can be found in the C standard library’s limits.h. - The Ming plugin that produced Shockwave files has been removed. This format was EOLed by Adobe in April 2019. #2160 - CentOS 7 packages now include libmingle and the `mingle` program. diff --git a/lib/common/arith.h b/lib/common/arith.h index b125f92d2..aca9389c7 100644 --- a/lib/common/arith.h +++ b/lib/common/arith.h @@ -39,14 +39,6 @@ extern "C" { #define SGN(a) (((a)<0)? -1 : 1) #define CMP(a,b) (((a)<(b)) ? -1 : (((a)>(b)) ? 1 : 0)) -#ifndef INT_MAX -#define INT_MAX ((int)(~(unsigned)0 >> 1)) -#endif - -#ifndef INT_MIN -#define INT_MIN (-INT_MAX - 1) -#endif - #ifndef MAXSHORT #define MAXSHORT (0x7fff) #endif