about summary refs log tree commit diff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-08-19T10·35+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-08-19T10·35+0200
commitd308aeaf53b7324af98dfa949a747526c241ef30 (patch)
treeacae7f07b45d26007e8a6bbc3d6c8bfa1bf5e34c /src/libutil/util.hh
parent297b762513ad416582c0850095506f802ff5b1bb (diff)
Store Nix integers as longs
So on 64-bit systems, integers are now 64-bit.

Fixes #158.
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 6c83987c5d..86c65b763d 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -319,7 +319,12 @@ template<class N> bool string2Int(const string & s, N & n)
     return str && str.get() == EOF;
 }
 
-string int2String(int n);
+template<class N> string int2String(N n)
+{
+    std::ostringstream str;
+    str << n;
+    return str.str();
+}
 
 
 /* Return true iff `s' ends in `suffix'. */