summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/prop/bvminisat/mtl/IntTypes.h14
-rw-r--r--src/prop/minisat/mtl/IntTypes.h14
2 files changed, 22 insertions, 6 deletions
diff --git a/src/prop/bvminisat/mtl/IntTypes.h b/src/prop/bvminisat/mtl/IntTypes.h
index 19ca38bea..7856dc07c 100644
--- a/src/prop/bvminisat/mtl/IntTypes.h
+++ b/src/prop/bvminisat/mtl/IntTypes.h
@@ -30,12 +30,20 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#else
-# include <stdint.h>
-# include <inttypes.h>
+// In contrast to the original MiniSat source code, we are including the
+// cstdint/cinttypes/climits headers instead of stdint.h/inttypes.h/limits.h
+// here. This ensures that the macros in cinttypes/inttypes.h, e.g., PRIi64,
+// are actually defined. The C99 standard suggested that those macros are only
+// defined for C++ code when __STDC_FORMAT_MACROS is defined. This was never
+// adopted by a C++ standard (https://en.cppreference.com/w/cpp/types/integer).
+// However, certain versions of mingw-w64 seem to require it with inttypes.h
+// but not cinttypes.
+# include <cstdint>
+# include <cinttypes>
#endif
-#include <limits.h>
+#include <climits>
//=================================================================================================
diff --git a/src/prop/minisat/mtl/IntTypes.h b/src/prop/minisat/mtl/IntTypes.h
index c48816284..f1fc84163 100644
--- a/src/prop/minisat/mtl/IntTypes.h
+++ b/src/prop/minisat/mtl/IntTypes.h
@@ -30,12 +30,20 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#else
-# include <stdint.h>
-# include <inttypes.h>
+// In contrast to the original MiniSat source code, we are including the
+// cstdint/cinttypes/climits headers instead of stdint.h/inttypes.h/limits.h
+// here. This ensures that the macros in cinttypes/inttypes.h such as PRIi64
+// are actually defined. The C99 standard suggested that those macros are only
+// defined for C++ code when __STDC_FORMAT_MACROS is defined. This was never
+// adopted by a C++ standard (https://en.cppreference.com/w/cpp/types/integer).
+// However, certain versions of mingw-w64 seem to require it with inttypes.h
+// but not cinttypes.
+# include <cstdint>
+# include <cinttypes>
#endif
-#include <limits.h>
+#include <climits>
//=================================================================================================
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback