diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c
index 45979a57..02cb2855 100644
--- a/src/json.hpp.re2c
+++ b/src/json.hpp.re2c
@@ -1983,7 +1983,7 @@ class basic_json
         o.width(0);
 
         // do the actual serialization
-        j.dump(o, prettyPrint, indentation);
+        j.dump(o, prettyPrint, static_cast<int>(indentation));
         return o;
     }