Blame


1 53ccebc2 2019-07-30 stsp /*
2 53ccebc2 2019-07-30 stsp * Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
3 53ccebc2 2019-07-30 stsp *
4 53ccebc2 2019-07-30 stsp * Permission to use, copy, modify, and distribute this software for any
5 53ccebc2 2019-07-30 stsp * purpose with or without fee is hereby granted, provided that the above
6 53ccebc2 2019-07-30 stsp * copyright notice and this permission notice appear in all copies.
7 53ccebc2 2019-07-30 stsp *
8 53ccebc2 2019-07-30 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 53ccebc2 2019-07-30 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 53ccebc2 2019-07-30 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 53ccebc2 2019-07-30 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 53ccebc2 2019-07-30 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 53ccebc2 2019-07-30 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 53ccebc2 2019-07-30 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 53ccebc2 2019-07-30 stsp */
16 53ccebc2 2019-07-30 stsp
17 53ccebc2 2019-07-30 stsp #ifndef GOT_VERSION
18 53ccebc2 2019-07-30 stsp #error "GOT_VERSION is undefined"
19 53ccebc2 2019-07-30 stsp #endif
20 53ccebc2 2019-07-30 stsp
21 bb63914a 2020-02-17 stsp #define GOT_STRINGIFY_VERSION(x) #x
22 bb63914a 2020-02-17 stsp #define GOT_STRINGVAL_VERSION(x) GOT_STRINGIFY_VERSION(x)
23 53ccebc2 2019-07-30 stsp
24 bb63914a 2020-02-17 stsp #define GOT_VERSION_STR GOT_STRINGVAL_VERSION(GOT_VERSION)
25 53ccebc2 2019-07-30 stsp
26 53ccebc2 2019-07-30 stsp static inline void
27 53ccebc2 2019-07-30 stsp got_version_print_str(void)
28 53ccebc2 2019-07-30 stsp {
29 53ccebc2 2019-07-30 stsp printf("%s %s\n", getprogname(), GOT_VERSION_STR);
30 53ccebc2 2019-07-30 stsp }