File: version.cpp

package info (click to toggle)
xca 2.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,328 kB
  • sloc: cpp: 30,584; sh: 341; xml: 74; makefile: 56; python: 34
file content (28 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* vi: set sw=4 ts=4:
 *
 * Copyright (C) 2018 Christian Hohnstaedt.
 *
 * All rights reserved.
 * Compiles much faster than MW_help.cpp
 * and needs to get recompiled every time
 */

#include "local.h"

#define VERSION XCA_VERSION

#ifdef GIT_LOCAL_CHANGES
#define COMMITHASH GIT_COMMIT_REV "+local-changes"
#else
#define COMMITHASH GIT_COMMIT_REV
#endif

const char *version_str(bool html)
{
	if (!COMMITHASH[0])
		return html ? "<b>" VERSION "</b>" : VERSION;

	return html ?
		"<b>" VERSION "-dev</b><br/>commit: <b>" COMMITHASH "</b>" :
		VERSION "-dev\ncommit: " COMMITHASH;
}