diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-31 10:44:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-13 10:45:26 +0300 |
commit | bd7e4d2a3db3231cde0b25666d3293e20cca8e92 (patch) | |
tree | c90d4794609e7caf1b06693a756167593db47c12 /intern/cycles/util | |
parent | ed050753ce3fda539ed46ed314019a34b1358486 (diff) |
Tweaks to the version string formation
Couple of things:
- No need to use string streams to format the version string,
we can do it at compile time and don't bother with anything
at runtime.
- Function declaration was wring and would have caused linking
conflicts in cases when util_version.h was included from
multiple places.
We should have an utility function to get Cycles version so
applications which are linked to Cycles dynamically can query
the version, but that can't be done as an inlined function in
header and would need to be a function properly exported to a
global symbol table (aka, be implemented in a .cpp file).
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_version.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/intern/cycles/util/util_version.h b/intern/cycles/util/util_version.h index 19847410e51..65918672596 100644 --- a/intern/cycles/util/util_version.h +++ b/intern/cycles/util/util_version.h @@ -27,18 +27,13 @@ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MINOR 7 #define CYCLES_VERSION_PATCH 0 -/* Create string number, like "1.7.0" */ -string cycles_version_number() -{ - stringstream ss; - ss << CYCLES_VERSION_MAJOR << "." - << CYCLES_VERSION_MINOR << "." - << CYCLES_VERSION_PATCH; - - return ss.str(); -} +#define CYCLES_MAKE_VERSION_STRING2(a,b,c) #a "." #b "." #c +#define CYCLES_MAKE_VERSION_STRING(a,b,c) CYCLES_MAKE_VERSION_STRING2(a,b,c) +#define CYCLES_VERSION_STRING \ + CYCLES_MAKE_VERSION_STRING(CYCLES_VERSION_MAJOR, \ + CYCLES_VERSION_MINOR, \ + CYCLES_VERSION_PATCH) CCL_NAMESPACE_END #endif /* __UTIL_VERSION_H__ */ - |