[arrayfire] 75/284: FEAT add af_get_revision to get commit instead of AF_REVISION

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun Feb 7 18:59:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/experimental
in repository arrayfire.

commit 06d4befbd5282b47b5731b3664ee951e3fbcbace
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Mon Dec 14 18:44:37 2015 -0500

    FEAT add af_get_revision to get commit instead of AF_REVISION
---
 include/af/util.h        | 12 +++++++++++-
 src/api/c/version.cpp    | 16 ++++++++++++++++
 src/api/unified/util.cpp |  5 +++++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/include/af/util.h b/include/af/util.h
index a563376..eef46f4 100644
--- a/include/af/util.h
+++ b/include/af/util.h
@@ -248,10 +248,20 @@ extern "C" {
     AFAPI af_err af_example_function(af_array* out, const af_array in, const af_someenum_t param);
 
     ///
-    ///Get the version information of the library
+    /// Get the version information of the library
     ///
     AFAPI af_err af_get_version(int *major, int *minor, int *patch);
 
+
+#if AF_API_VERSION >= 33
+    ///
+    /// Get the revision (commit) information of the library.
+    /// This returns a constant string from compile time and should not be
+    /// freed by the user.
+    ///
+    AFAPI const char *af_get_revision();
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/api/c/version.cpp b/src/api/c/version.cpp
new file mode 100644
index 0000000..4eb7883
--- /dev/null
+++ b/src/api/c/version.cpp
@@ -0,0 +1,16 @@
+/*******************************************************
+ * Copyright (c) 2014, ArrayFire
+ * All rights reserved.
+ *
+ * This file is distributed under 3-clause BSD license.
+ * The complete license agreement can be obtained at:
+ * http://arrayfire.com/licenses/BSD-3-Clause
+ ********************************************************/
+
+#include <af/util.h>
+#include <version.hpp>
+
+const char *af_get_revision()
+{
+    return AF_REVISION;
+}
diff --git a/src/api/unified/util.cpp b/src/api/unified/util.cpp
index 155c4f8..1a4dcf5 100644
--- a/src/api/unified/util.cpp
+++ b/src/api/unified/util.cpp
@@ -61,3 +61,8 @@ af_err af_get_version(int *major, int *minor, int *patch)
 {
     return CALL(major, minor, patch);
 }
+
+const char *af_get_revision()
+{
+    return CALL_NO_PARAMS();
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list