aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/gemcutter/json_things.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/gemcutter/json_things.cc')
-rw-r--r--paludis/repositories/gemcutter/json_things.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/paludis/repositories/gemcutter/json_things.cc b/paludis/repositories/gemcutter/json_things.cc
index e7c1d0db1..182f05b77 100644
--- a/paludis/repositories/gemcutter/json_things.cc
+++ b/paludis/repositories/gemcutter/json_things.cc
@@ -73,7 +73,11 @@ gemcutter_json_things_parse_all_gems(
Context context("When parsing '" + stringify(path) + "':");
json_error_t error;
+#if JANSSON_MAJOR_VERSION >= 2
+ json_t * root(json_load_file(stringify(path).c_str(), 0, &error));
+#else
json_t * root(json_load_file(stringify(path).c_str(), &error));
+#endif
if (! root)
throw JSONError("Couldn't load '" + stringify(path) + "': jansson said: " + error.text);