chore(util/*): add cstddef header before including gmp.h/mpfr.h

Reference: https://gcc.gnu.org/gcc-4.9/porting_to.html

------

Header <cstddef> changes

The <cstddef> 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 <cstddef> or
<stddef.h> before any headers from that library.
This commit is contained in:
Soonho Kong 2014-10-06 22:36:22 -07:00
parent 4350382b90
commit 39645390ff
6 changed files with 6 additions and 0 deletions

View file

@ -6,6 +6,7 @@ Author: Leonardo de Moura
Soonho Kong
*/
#pragma once
#include <cstddef>
#include <gmp.h>
#include <mpfr.h>
#include <utility>

View file

@ -5,6 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Author: Soonho Kong
*/
#pragma once
#include <cstddef>
#include <mpfr.h>
#include "util/numerics/mpfp.h"

View file

@ -5,6 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Author: Soonho Kong
*/
#pragma once
#include <cstddef>
#include <mpfr.h>
#include "util/numerics/mpfp.h"

View file

@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include <cstddef>
#include <gmp.h>
#include "util/memory.h"
#include "util/numerics/mpz.h"

View file

@ -6,6 +6,7 @@ Author: Soonho Kong
*/
#pragma once
#include <stdint.h>
#include <cstddef>
#include <mpfr.h>
#include "util/numerics/mpz.h"
#include "util/numerics/mpq.h"

View file

@ -5,6 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <cstddef>
#include <gmp.h>
#include <iostream>
#include "util/debug.h"