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 <cstddef> // See https://gcc.gnu.org/gcc-4.9/porting_to.html 7 #include <mpfi.h> 8 #include <boost/config.hpp> 9 10 #ifdef __GNUC__ 11 #pragma message "MPFR_VERSION_STRING=" MPFR_VERSION_STRING 12 #endif 13 14 #if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) 15 #error "Incompatible GMP version" 16 #endif 17 18 #if (MPFR_VERSION < 3) 19 #error "Incompatible MPFR version" 20 #endif 21 22 #ifdef __GNUC__ 23 #pragma message "__GNU_MP_VERSION=" BOOST_STRINGIZE(__GNU_MP_VERSION) 24 #pragma message "__GNU_MP_VERSION_MINOR=" BOOST_STRINGIZE(__GNU_MP_VERSION_MINOR) 25 #endif 26 27 #if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) 28 #error "Incompatible GMP version" 29 #endif 30 31 /* 32 #ifdef __GNUC__ 33 #pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR) 34 #pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR) 35 #endif 36 37 #if MPFI_VERSION_MAJOR < 1 38 #error "Incompatible MPFI version" 39 #endif 40 #if (MPFI_VERSION_MAJOR == 1) && (MPFI_VERSION_MINOR < 5) 41 #error "Incompatible MPFI version" 42 #endif 43 */ main()44int main() 45 { 46 void *(*alloc_func_ptr) (size_t); 47 void *(*realloc_func_ptr) (void *, size_t, size_t); 48 void (*free_func_ptr) (void *, size_t); 49 50 mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr); 51 52 mpfr_buildopt_tls_p(); 53 54 mpfi_t t; 55 mpfi_init2(t, 128); 56 if(t[0].left._mpfr_d) 57 mpfi_clear(t); 58 59 60 return 0; 61 } 62 63