diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+0.4.4: 15 Jan 2018: Fix compilation with mpfr-4.0.0.0
 0.4.3: 7 Aug 2017: expose all modules
 0.4.2.1: 28 Dec 2016: instance Generic MPFR
 0.4.2: 2nd Sep 2016: Added RealFloat instances
diff --git a/cbits/chsmpfr.c b/cbits/chsmpfr.c
--- a/cbits/chsmpfr.c
+++ b/cbits/chsmpfr.c
@@ -20,7 +20,11 @@
   return state;
 }
 
+#if defined (_MPFR_PROTO)
 __MPFR_DECLSPEC int mpfr_urandomb_deref_randstate _MPFR_PROTO ((mpfr_ptr dP, gmp_randstate_t * rsP))
+#else
+__MPFR_DECLSPEC int mpfr_urandomb_deref_randstate (mpfr_ptr dP, gmp_randstate_t * rsP)
+#endif
 {
   return mpfr_urandomb(dP, * rsP);
 }
@@ -33,7 +37,7 @@
   return mpfr_inf_p(p);
 }
 int mpfr_zero_p_wrap(const mpfr_ptr p) {
-  return mpfr_zero_p(p); 
+  return mpfr_zero_p(p);
 }
 
 int mpfr_set_wrap(const mpfr_ptr p1, const mpfr_ptr p2, mp_rnd_t r) {
@@ -58,7 +62,7 @@
 
 int mpfr_sgn_wrap (const mpfr_ptr p1) {
   return mpfr_sgn (p1);
-} 
+}
 
 int mpfr_set_si_wrap (const mpfr_ptr p, long int si, mp_rnd_t r) {
   return mpfr_set_si(p, si, r);
@@ -105,7 +109,7 @@
 }
 
 size_t mpfr_custom_get_size_wrap (mp_prec_t p1) {
-  return mpfr_custom_get_size (p1); 
+  return mpfr_custom_get_size (p1);
 }
 
 void mpfr_custom_init_wrap (void *p1 , mp_prec_t p2) {
diff --git a/cbits/chsmpfr.h b/cbits/chsmpfr.h
--- a/cbits/chsmpfr.h
+++ b/cbits/chsmpfr.h
@@ -8,7 +8,11 @@
 
 gmp_randstate_t * new_gmp_randstate();
 
+#if defined (_MPFR_PROTO)
 __MPFR_DECLSPEC int mpfr_urandomb_deref_randstate _MPFR_PROTO ((mpfr_ptr dP, gmp_randstate_t * rsP));
+#else
+__MPFR_DECLSPEC int mpfr_urandomb_deref_randstate (mpfr_ptr dP, gmp_randstate_t * rsP);
+#endif
 
 // these functions are defined as macros and so haskell ffi 
 // can't work with them directly
diff --git a/hmpfr.cabal b/hmpfr.cabal
--- a/hmpfr.cabal
+++ b/hmpfr.cabal
@@ -1,5 +1,5 @@
 name:                hmpfr
-version:             0.4.3
+version:             0.4.4
 synopsis:            Haskell binding to the MPFR library
 description:
   Haskell binding to the MPFR library.
@@ -16,7 +16,8 @@
 Stability:           experimental
 Tested-with:
                 GHC==7.10.3
-                GHC==8.0.1
+                GHC==8.0.2
+                GHC==8.2.2
 author:              Aleš Bizjak, Michal Konečný
 maintainer:          Michal Konečný <mikkonecny@gmail.com>
 Homepage:            https://github.com/michalkonecny/hmpfr
