~ubuntu-branches/ubuntu/precise/ceph/precise-proposed

« back to all changes in this revision

Viewing changes to src/common/version.cc

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2011-04-25 10:09:05 UTC
  • mfrom: (1.1.3 upstream) (0.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110425100905-exm7dfvi2v5ick02
Tags: 0.27-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 
2
// vim: ts=8 sw=2 smarttab
 
3
/*
 
4
 * Ceph - scalable distributed file system
 
5
 *
 
6
 * Copyright (C) 2011 New Dream Network
 
7
 *
 
8
 * This is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Lesser General Public
 
10
 * License version 2.1, as published by the Free Software
 
11
 * Foundation.  See file COPYING.
 
12
 *
 
13
 */
 
14
 
 
15
#include "acconfig.h"
 
16
#include "ceph_ver.h"
 
17
#include "common/version.h"
 
18
 
 
19
#include <sstream>
 
20
#include <string>
 
21
 
 
22
#define _STR(x) #x
 
23
#define STRINGIFY(x) _STR(x)
 
24
 
 
25
const char *ceph_version_to_str(void)
 
26
{
 
27
  return CEPH_GIT_NICE_VER;
 
28
}
 
29
 
 
30
const char *git_version_to_str(void)
 
31
{
 
32
  return STRINGIFY(CEPH_GIT_VER);
 
33
}
 
34
 
 
35
std::string const pretty_version_to_str(void)
 
36
{
 
37
  std::ostringstream oss;
 
38
  oss << "ceph version " << CEPH_GIT_NICE_VER << " (commit:"
 
39
      << STRINGIFY(CEPH_GIT_VER) << ")";
 
40
  return oss.str();
 
41
}