core-lightning/common/version.c
Rusty Russell 4ffda340d3 check: make sure all files outside contrib/ include "config.h" first.
And turn "" includes into full-path (which makes it easier to put
config.h first, and finds some cases check-includes.sh missed
previously).

config.h sets _GNU_SOURCE which really needs to be done before any
'#includes': we mainly got away with it with glibc, but other platforms
like Alpine may have stricter requirements.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-12-06 10:05:39 +10:30

23 lines
427 B
C

#include "config.h"
#include <ccan/compiler/compiler.h>
#include <common/version.h>
#include <stdio.h>
#include <stdlib.h>
/* Only common/version.c can safely include this. */
# include "version_gen.h"
const char *version(void)
{
return VERSION;
}
char *version_and_exit(const void *unused UNUSED)
{
printf("%s\n", VERSION);
if (BUILD_FEATURES[0]) {
printf("Built with features: %s\n", BUILD_FEATURES);
}
exit(0);
}