Skip to content

Commit 9423192

Browse files
committed
BUG: Correct DIFFPY_VERSION macro in scons.
Problem: For alpha releases DIFFPY_VERSION is a `(N - 500)` expression so appending `LL` to force `long long` is invalid. Solution: Append `LL` in the scons script that resolves the version.
1 parent 65badff commit 9423192

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/diffpy/SConscript.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def build_VersionCode(target, source, env):
2626
assert numversion // 1000000 % 1000 == ginfo['minor'], emsg
2727
assert numversion // 1000 % 1000 == ginfo['micro'], emsg
2828
assert numversion % 500 == ginfo['patchnumber'], emsg
29-
libversion = str(numversion)
29+
libversion = str(numversion) + "LL"
3030
if ginfo['prerelease']:
3131
libversion = "(-500 + %s)" % libversion
3232
flds = {

src/diffpy/version.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818

1919
#include <diffpy/version.hpp>
2020

21-
// Append LL suffix to the DIFFPY_VERSION number.
22-
#define APPEND(x, y) x ## y
23-
#define LL(x) APPEND(x, LL)
24-
25-
const long long libdiffpy_version_info::version = LL(DIFFPY_VERSION);
21+
const long long libdiffpy_version_info::version = DIFFPY_VERSION;
2622
const char* libdiffpy_version_info::version_str = DIFFPY_VERSION_STR;
2723
const int libdiffpy_version_info::major = DIFFPY_VERSION_MAJOR;
2824
const int libdiffpy_version_info::minor = DIFFPY_VERSION_MINOR;

0 commit comments

Comments
 (0)