Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / multiprecision / config / has_mpfi.cpp
1 //  Copyright John Maddock 2012.
2 //  Use, modification and distribution are subject to the
3 //  Boost Software License, Version 1.0. (See accompanying file
4 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6 #include <mpfi.h>
7 #include <boost/config.hpp>
8
9 #ifdef __GNUC__
10 #pragma message "MPFR_VERSION_STRING=" MPFR_VERSION_STRING
11 #endif
12
13 #if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2))
14 #error "Incompatible GMP version"
15 #endif
16
17 #if (MPFR_VERSION < 3)
18 #error "Incompatible MPFR version"
19 #endif
20
21 #ifdef __GNUC__
22 #pragma message "__GNU_MP_VERSION=" BOOST_STRINGIZE(__GNU_MP_VERSION)
23 #pragma message "__GNU_MP_VERSION_MINOR=" BOOST_STRINGIZE(__GNU_MP_VERSION_MINOR)
24 #endif 
25
26 #if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2))
27 #error "Incompatible GMP version"
28 #endif
29
30 /*
31 #ifdef __GNUC__
32 #pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR)
33 #pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR)
34 #endif 
35
36 #if MPFI_VERSION_MAJOR < 1
37 #error "Incompatible MPFI version"
38 #endif
39 #if (MPFI_VERSION_MAJOR == 1) && (MPFI_VERSION_MINOR < 5)
40 #error "Incompatible MPFI version"
41 #endif
42 */
43 int main()
44 {
45    void *(*alloc_func_ptr) (size_t);
46    void *(*realloc_func_ptr) (void *, size_t, size_t);
47    void (*free_func_ptr) (void *, size_t);
48
49    mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr);
50
51    mpfr_buildopt_tls_p();
52
53    return 0;
54 }
55