diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-08-19T10·35+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-08-19T10·35+0200 |
commit | d308aeaf53b7324af98dfa949a747526c241ef30 (patch) | |
tree | acae7f07b45d26007e8a6bbc3d6c8bfa1bf5e34c /src/libexpr/value.hh | |
parent | 297b762513ad416582c0850095506f802ff5b1bb (diff) |
Store Nix integers as longs
So on 64-bit systems, integers are now 64-bit. Fixes #158.
Diffstat (limited to 'src/libexpr/value.hh')
-rw-r--r-- | src/libexpr/value.hh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh index d49381a59165..ee5c7397b3a9 100644 --- a/src/libexpr/value.hh +++ b/src/libexpr/value.hh @@ -31,14 +31,17 @@ struct PrimOp; struct Symbol; +typedef long NixInt; + + struct Value { ValueType type; - union + union { - int integer; + NixInt integer; bool boolean; - + /* Strings in the evaluator carry a so-called `context' which is a list of strings representing store paths. This is to allow users to write things like @@ -63,7 +66,7 @@ struct Value const char * s; const char * * context; // must be in sorted order } string; - + const char * path; Bindings * attrs; struct { @@ -97,7 +100,7 @@ static inline void clearValue(Value & v) } -static inline void mkInt(Value & v, int n) +static inline void mkInt(Value & v, NixInt n) { clearValue(v); v.type = tInt; |