From 39645390ffc265b28ee9c8265c1f7e4736e3148c Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Mon, 6 Oct 2014 22:36:22 -0700 Subject: [PATCH] chore(util/*): add cstddef header before including gmp.h/mpfr.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reference: https://gcc.gnu.org/gcc-4.9/porting_to.html ------ Header changes The header was updated for C++11 support and this breaks some libraries which misuse macros meant for internal use by GCC only. For instance with GMP versions up to 5.1.3, you may see: /usr/include/c++/4.9.0/cstddef:51:11: error: ‘::max_align_t’ has not been declared using ::max_align_t; ^ Another possible error is: someheader.h:99:13: error: ‘ptrdiff_t’ does not name a type A workaround until libraries get updated is to include or before any headers from that library. --- src/util/interval/interval.cpp | 1 + src/util/numerics/double.h | 1 + src/util/numerics/float.h | 1 + src/util/numerics/init_module.cpp | 1 + src/util/numerics/mpfp.h | 1 + src/util/numerics/mpz.h | 1 + 6 files changed, 6 insertions(+) diff --git a/src/util/interval/interval.cpp b/src/util/interval/interval.cpp index 36fcde31e..6fc5000fd 100644 --- a/src/util/interval/interval.cpp +++ b/src/util/interval/interval.cpp @@ -6,6 +6,7 @@ Author: Leonardo de Moura Soonho Kong */ #pragma once +#include #include #include #include diff --git a/src/util/numerics/double.h b/src/util/numerics/double.h index 4a908f411..34d4e84e6 100644 --- a/src/util/numerics/double.h +++ b/src/util/numerics/double.h @@ -5,6 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Author: Soonho Kong */ #pragma once +#include #include #include "util/numerics/mpfp.h" diff --git a/src/util/numerics/float.h b/src/util/numerics/float.h index c9cd5796e..7a11d842e 100644 --- a/src/util/numerics/float.h +++ b/src/util/numerics/float.h @@ -5,6 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Author: Soonho Kong */ #pragma once +#include #include #include "util/numerics/mpfp.h" diff --git a/src/util/numerics/init_module.cpp b/src/util/numerics/init_module.cpp index c3ae5aa21..4ad081f3e 100644 --- a/src/util/numerics/init_module.cpp +++ b/src/util/numerics/init_module.cpp @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ +#include #include #include "util/memory.h" #include "util/numerics/mpz.h" diff --git a/src/util/numerics/mpfp.h b/src/util/numerics/mpfp.h index 0c0c37218..ab9f9deb1 100644 --- a/src/util/numerics/mpfp.h +++ b/src/util/numerics/mpfp.h @@ -6,6 +6,7 @@ Author: Soonho Kong */ #pragma once #include +#include #include #include "util/numerics/mpz.h" #include "util/numerics/mpq.h" diff --git a/src/util/numerics/mpz.h b/src/util/numerics/mpz.h index c872e6207..84ccb7915 100644 --- a/src/util/numerics/mpz.h +++ b/src/util/numerics/mpz.h @@ -5,6 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once +#include #include #include #include "util/debug.h"