has_mpc.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright John Maddock 2018.
  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. #include <cstddef> // See https://gcc.gnu.org/gcc-4.9/porting_to.html
  6. #include <mpc.h>
  7. #include <boost/config.hpp>
  8. #ifdef __GNUC__
  9. #pragma message "MPFR_VERSION_STRING=" MPFR_VERSION_STRING
  10. #endif
  11. #if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2))
  12. #error "Incompatible GMP version"
  13. #endif
  14. #if (MPFR_VERSION < 3)
  15. #error "Incompatible MPFR version"
  16. #endif
  17. #ifdef __GNUC__
  18. #pragma message "__GNU_MP_VERSION=" BOOST_STRINGIZE(__GNU_MP_VERSION)
  19. #pragma message "__GNU_MP_VERSION_MINOR=" BOOST_STRINGIZE(__GNU_MP_VERSION_MINOR)
  20. #endif
  21. #if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2))
  22. #error "Incompatible GMP version"
  23. #endif
  24. /*
  25. #ifdef __GNUC__
  26. #pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR)
  27. #pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR)
  28. #endif
  29. #if MPFI_VERSION_MAJOR < 1
  30. #error "Incompatible MPFI version"
  31. #endif
  32. #if (MPFI_VERSION_MAJOR == 1) && (MPFI_VERSION_MINOR < 5)
  33. #error "Incompatible MPFI version"
  34. #endif
  35. */
  36. int main()
  37. {
  38. void* (*alloc_func_ptr)(size_t);
  39. void* (*realloc_func_ptr)(void*, size_t, size_t);
  40. void (*free_func_ptr)(void*, size_t);
  41. mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr);
  42. mpfr_buildopt_tls_p();
  43. mpc_t t;
  44. mpc_init2(t, 128);
  45. mpc_clear(t);
  46. return 0;
  47. }