]> granicus.if.org Git - graphviz/commitdiff
API BREAK: remove local 'INT_MAX' and 'INT_MIN' definitions
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 8 Jan 2022 01:40:03 +0000 (17:40 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 9 Jan 2022 23:51:57 +0000 (15:51 -0800)
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.

CHANGELOG.md
lib/common/arith.h

index 3fd3a43715980346a332f5300b1eaf9a9ae9287d..28c3b02d75a2dd8afeff4cce264d5a9e8950350e 100644 (file)
@@ -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.
index b125f92d26ed38df974830925837c877958f8e9d..aca9389c76242de42aa93c854d2fec33e2270c30 100644 (file)
@@ -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