about summary refs log tree commit diff
path: root/src/libexpr/value.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/value.hh')
-rw-r--r--src/libexpr/value.hh17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh
index 62bdd9281f08..271e6a1b24a2 100644
--- a/src/libexpr/value.hh
+++ b/src/libexpr/value.hh
@@ -1,7 +1,12 @@
 #pragma once
 
+#include "config.h"
 #include "symbol-table.hh"
 
+#if HAVE_BOEHMGC
+#include <gc/gc_allocator.h>
+#endif
+
 namespace nix {
 
 
@@ -36,6 +41,7 @@ class Symbol;
 struct Pos;
 class EvalState;
 class XMLWriter;
+class JSONPlaceholder;
 
 
 typedef long NixInt;
@@ -73,7 +79,7 @@ class ExternalValueBase
 
     /* Print the value as JSON. Defaults to unconvertable, i.e. throws an error */
     virtual void printValueAsJSON(EvalState & state, bool strict,
-        std::ostream & str, PathSet & context) const;
+        JSONPlaceholder & out, PathSet & context) const;
 
     /* Print the value as XML. Defaults to unevaluated */
     virtual void printValueAsXML(EvalState & state, bool strict, bool location,
@@ -249,4 +255,13 @@ void mkPath(Value & v, const char * s);
 size_t valueSize(Value & v);
 
 
+#if HAVE_BOEHMGC
+typedef std::vector<Value *, gc_allocator<Value *> > ValueVector;
+typedef std::map<Symbol, Value *, std::less<Symbol>, gc_allocator<Value *> > ValueMap;
+#else
+typedef std::vector<Value *> ValueVector;
+typedef std::map<Symbol, Value *> ValueMap;
+#endif
+
+
 }