diff options
author | Marius Kintel <marius@kintel.net> | 2011-11-08 22:27:37 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-11-08 22:27:37 (GMT) |
commit | bd8fb851f58e089c6230a5e694846ba618fc8879 (patch) | |
tree | e45b2cc5b28c3f3cc6351e70898fdac7e833cb5c | |
parent | 0b036e0e205db596a0617e425e7d685d2e999e57 (diff) |
Fix for dates being interpreted as octal numbers
-rw-r--r-- | src/func.cc | 6 | ||||
-rw-r--r-- | version.pri | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/func.cc b/src/func.cc index a9d5948..3a1af42 100644 --- a/src/func.cc +++ b/src/func.cc @@ -351,10 +351,10 @@ Value builtin_version(const Context *, const std::vector<std::string>&, const st { Value val; val.type = Value::VECTOR; - val.append(new Value(double(OPENSCAD_YEAR))); - val.append(new Value(double(OPENSCAD_MONTH))); + val.append(new Value(OPENSCAD_YEAR)); + val.append(new Value(OPENSCAD_MONTH)); #ifdef OPENSCAD_DAY - val.append(new Value(double(OPENSCAD_DAY))); + val.append(new Value(OPENSCAD_DAY)); #endif return val; } diff --git a/version.pri b/version.pri index 5cce3d5..195c51a 100644 --- a/version.pri +++ b/version.pri @@ -56,4 +56,9 @@ isEmpty(VERSION) { VERSION_MONTH=$$member(VERSION_SPLIT, 1) VERSION_DAY=$$member(VERSION_SPLIT, 2) } + # Fix for problem with integers with leading zeros + # being interpreted by C++ as octals. Now they're doubles. + VERSION_YEAR=$${VERSION_YEAR}.0 + VERSION_MONTH=$${VERSION_MONTH}.0 + VERSION_DAY=$${VERSION_DAY}.0 } |