mirror of
https://github.com/NixOS/nix
synced 2025-06-29 06:21:14 +02:00
Store Nix integers as longs
So on 64-bit systems, integers are now 64-bit. Fixes #158.
This commit is contained in:
parent
297b762513
commit
d308aeaf53
9 changed files with 25 additions and 23 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue