Commit 5006ed5f authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

version: Define version as a macro

Defining it as static char is a bad idea especially
if it get included and never used -- we will get
"unused" variable error.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 5aa409af
...@@ -265,7 +265,7 @@ int main(int argc, char *argv[]) ...@@ -265,7 +265,7 @@ int main(int argc, char *argv[])
opts.check_ms_kernel = true; opts.check_ms_kernel = true;
break; break;
case 'V': case 'V':
pr_msg("Version: %s\n", version); pr_msg("Version: %s\n", CRIU_VERSION);
return 0; return 0;
case 'h': case 'h':
default: default:
......
#include "version.h" #include "version.h"
const char *criu_lib_version = version; const char *criu_lib_version = CRIU_VERSION;
...@@ -7,9 +7,7 @@ $(VERSION_HEADER): Makefile scripts/Makefile.version ...@@ -7,9 +7,7 @@ $(VERSION_HEADER): Makefile scripts/Makefile.version
$(Q) echo "/* Autogenerated, do not edit */" > $(VERSION_HEADER) $(Q) echo "/* Autogenerated, do not edit */" > $(VERSION_HEADER)
$(Q) echo "#ifndef __CR_VERSION_H__" >> $(VERSION_HEADER) $(Q) echo "#ifndef __CR_VERSION_H__" >> $(VERSION_HEADER)
$(Q) echo "#define __CR_VERSION_H__" >> $(VERSION_HEADER) $(Q) echo "#define __CR_VERSION_H__" >> $(VERSION_HEADER)
$(Q) echo "static char version[] = {" >> $(VERSION_HEADER) $(Q) echo "#define CRIU_VERSION \"$(CRTOOLSVERSION)\"" >> $(VERSION_HEADER)
$(Q) echo \"$(CRTOOLSVERSION)\" >> $(VERSION_HEADER)
$(Q) echo "};" >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION_MAJOR " $(VERSION_MAJOR) >> $(VERSION_HEADER) $(Q) echo "#define CRIU_VERSION_MAJOR " $(VERSION_MAJOR) >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION_MINOR " $(VERSION_MINOR) >> $(VERSION_HEADER) $(Q) echo "#define CRIU_VERSION_MINOR " $(VERSION_MINOR) >> $(VERSION_HEADER)
$(Q) echo "#endif /* __CR_VERSION_H__ */" >> $(VERSION_HEADER) $(Q) echo "#endif /* __CR_VERSION_H__ */" >> $(VERSION_HEADER)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment