mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-28 17:04:58 -04:00
Prepare for merging
This commit is contained in:
parent
b1860d8682
commit
1d4ca64dee
27 changed files with 1442 additions and 992 deletions
|
@ -3,7 +3,8 @@
|
|||
* *
|
||||
* libretroshare: retroshare core library *
|
||||
* *
|
||||
* Copyright 2012-2018 by Retroshare Team <retroshare.project@gmail.com> *
|
||||
* Copyright (C) 2012-2018 Retroshare Team <contact@retroshare.cc> *
|
||||
* Copyright (C) 2018-2019 Gioacchino Mazzurco <gio@eigenlab.org> *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Lesser General Public License as *
|
||||
|
@ -21,7 +22,6 @@
|
|||
*******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
|
||||
/**
|
||||
* @def RS_MINI_VERSION
|
||||
* First number of RetroShare versioning scheme
|
||||
|
@ -69,13 +69,45 @@
|
|||
(RS_MINOR_VERSION == (B) && RS_MINI_VERSION >= (C)))))
|
||||
|
||||
|
||||
#define __RS_PRIVATE_STRINGIFY2(X) #X
|
||||
#define __RS_PRIVATE_STRINGIFY(X) __RS_PRIVATE_STRINGIFY2(X)
|
||||
#define RS_PRIVATE_STRINGIFY2(X) #X
|
||||
#define RS_PRIVATE_STRINGIFY(X) RS_PRIVATE_STRINGIFY2(X)
|
||||
|
||||
/**
|
||||
* Human readable string describing RetroShare version
|
||||
*/
|
||||
constexpr auto RS_HUMAN_READABLE_VERSION =
|
||||
__RS_PRIVATE_STRINGIFY(RS_MAJOR_VERSION) "." \
|
||||
__RS_PRIVATE_STRINGIFY(RS_MINOR_VERSION) "." \
|
||||
__RS_PRIVATE_STRINGIFY(RS_MINI_VERSION) RS_EXTRA_VERSION;
|
||||
RS_PRIVATE_STRINGIFY(RS_MAJOR_VERSION) "." \
|
||||
RS_PRIVATE_STRINGIFY(RS_MINOR_VERSION) "." \
|
||||
RS_PRIVATE_STRINGIFY(RS_MINI_VERSION) RS_EXTRA_VERSION;
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* Helper to expose version information to JSON API.
|
||||
* From C++ you should use directly the macro and constants defined upstair
|
||||
* @jsonapi{development}
|
||||
*/
|
||||
class RsVersion
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Write version information to given paramethers
|
||||
* @jsonapi{development,unauthenticated}
|
||||
* @param[out] major storage
|
||||
* @param[out] minor storage
|
||||
* @param[out] mini storage
|
||||
* @param[out] extra storage
|
||||
* @param[out] human storage
|
||||
*/
|
||||
static void version( uint32_t& major, uint32_t& minor, uint32_t& mini,
|
||||
std::string& extra, std::string& human );
|
||||
};
|
||||
|
||||
/**
|
||||
* Pointer to global instance of RsVersion, for the sake of JSON API, from C++
|
||||
* you can use directly the macro and constants defined upstair
|
||||
* @jsonapi{development}
|
||||
*/
|
||||
extern RsVersion* rsVersion;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue