From 0479c91ba97888b89a952034a085cd10d70d6ba0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 26 Mar 2019 12:02:57 +0000 Subject: [PATCH] Add support for pre-release mode --- src/grib_context.c | 10 +++++----- tools/codes_info.c | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/grib_context.c b/src/grib_context.c index cb91bc8c6..f8b8df076 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -246,11 +246,11 @@ void grib_print_api_version(FILE* out) ECCODES_MAJOR_VERSION, ECCODES_MINOR_VERSION, ECCODES_REVISION_VERSION); - /* - * if (ECCODES_MAJOR_VERSION < 1) { - * fprintf(out, "%s", " PRE-RELEASE"); - * } - */ +#ifdef ECCODES_PRE_RELEASE + if (ECCODES_MAJOR_VERSION < 1) { + fprintf(out, "%s", " PRE-RELEASE"); + } +#endif } const char* grib_get_package_name() diff --git a/tools/codes_info.c b/tools/codes_info.c index 1f1f37a0a..3de54fb0c 100644 --- a/tools/codes_info.c +++ b/tools/codes_info.c @@ -65,7 +65,9 @@ int main( int argc,char* argv[]) printf("\n"); printf("%s Version %d.%d.%d", grib_get_package_name(), major,minor,revision); - /* if (ECCODES_MAJOR_VERSION < 1) printf(" PRE-RELEASE"); */ +#ifdef ECCODES_PRE_RELEASE + if (ECCODES_MAJOR_VERSION < 1) printf(" PRE-RELEASE"); +#endif printf("\n"); printf("\n"); if(context->debug) {