From eee76bfd26c76d80c92e166d5e16047a8816ea9a Mon Sep 17 00:00:00 2001 From: APTX Date: Thu, 12 Jan 2012 16:16:00 +0100 Subject: [PATCH] Add revision info. --- anidbudpclient.pro | 3 +++ client.cpp | 13 +++++++++++++ client.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/anidbudpclient.pro b/anidbudpclient.pro index 06fd0b4..e53759c 100644 --- a/anidbudpclient.pro +++ b/anidbudpclient.pro @@ -151,6 +151,9 @@ norenameparser { message(Disabled renameparser support) } +REV = $$system(git show-ref -s --verify refs/heads/master) +DEFINES += REVISION=\"$${REV}\" + target.path = $${PREFIX}/lib headers.path = $${PREFIX}/include/AniDBUdpClient diff --git a/client.cpp b/client.cpp index 142255d..4ad3b3d 100644 --- a/client.cpp +++ b/client.cpp @@ -1164,4 +1164,17 @@ Client *Client::m_instance = 0; const int Client::UDP_API_COMMAND_TIMEOUT; #endif +ANIDBUDPCLIENTSHARED_EXPORT char *revision() +{ +#ifdef REVISION +#define ANI_GET_REV_I(X) #X +#define ANI_GET_REV(X) ANI_GET_REV_I(X) + return ANI_GET_REV(REVISION); +#undef ANI_GET_REV_I +#undef ANI_GET_REV +#else + return 0; +#endif +} + } // namespace AniDBUdpClient diff --git a/client.h b/client.h index 980529e..edffa55 100644 --- a/client.h +++ b/client.h @@ -232,6 +232,8 @@ private: QHistoryState *connectedHistoryState; }; +ANIDBUDPCLIENTSHARED_EXPORT char *revision(); + } // namespace AniDBUdpClient #include -- 2.52.0