From 8b8ee53bc73769bb25d967ba259dabc9b23e2e6f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 27 Nov 2012 13:29:55 +0100 Subject: Add builtin constants ‘langVersion’ and ‘nixVersion’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The integer constant ‘langVersion’ denotes the current language version. It gets increased every time a language feature is added/changed/removed. It's currently 1. The string constant ‘nixVersion’ contains the current Nix version, e.g. "1.2pre2980_9de6bc5". --- src/libmain/Makefile.am | 1 - src/libmain/shared.cc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libmain') diff --git a/src/libmain/Makefile.am b/src/libmain/Makefile.am index 404353c62922..6a2d7f5f58e5 100644 --- a/src/libmain/Makefile.am +++ b/src/libmain/Makefile.am @@ -7,6 +7,5 @@ libmain_la_LIBADD = ../libstore/libstore.la @BDW_GC_LIBS@ pkginclude_HEADERS = shared.hh AM_CXXFLAGS = \ - -DNIX_VERSION=\"$(VERSION)\" \ -I$(srcdir)/.. -I$(srcdir)/../libutil \ -I$(srcdir)/../libstore diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 2cf5b08df32d..ead3fc017ae2 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -180,7 +180,7 @@ static void initAndRun(int argc, char * * argv) return; } else if (arg == "--version") { - std::cout << format("%1% (Nix) %2%") % programId % NIX_VERSION << std::endl; + std::cout << format("%1% (Nix) %2%") % programId % nixVersion << std::endl; return; } else if (arg == "--keep-failed" || arg == "-K") -- cgit 1.4.1