[arrayfire] 68/248: Added AF_MSG macro

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Nov 17 15:54:03 UTC 2015


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

ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.

commit 8d68ba5bc7d16e3aebf6236eacc7fcfc9d9cc466
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Tue Sep 22 13:04:44 2015 -0400

    Added AF_MSG macro
---
 include/af/macros.h     | 24 ++++++++++++++++++++++++
 src/backend/defines.hpp |  4 ++++
 2 files changed, 28 insertions(+)

diff --git a/include/af/macros.h b/include/af/macros.h
new file mode 100644
index 0000000..6c816c7
--- /dev/null
+++ b/include/af/macros.h
@@ -0,0 +1,24 @@
+/*******************************************************
+ * 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
+ ********************************************************/
+
+#pragma once
+#include <stdio.h>
+
+///
+/// Print a line on screen using printf syntax.
+/// Usage: Uses same syntax and semantics as printf.
+/// Output: <filename>:<line number>: <message>
+///
+#ifndef AF_MSG
+#define AF_MSG(fmt,...) do {            \
+        printf("%s:%d: " fmt "\n",      \
+                 __FILE__, __LINE__, ##__VA_ARGS__);      \
+        } while (0);
+#endif
+
diff --git a/src/backend/defines.hpp b/src/backend/defines.hpp
index 2689837..4308ca9 100644
--- a/src/backend/defines.hpp
+++ b/src/backend/defines.hpp
@@ -9,6 +9,10 @@
 
 #pragma once
 
+#include <af/macros.h>
+
+#define MSG AF_MSG
+
 #if defined(_WIN32) || defined(_MSC_VER)
     #define __PRETTY_FUNCTION__ __FUNCSIG__
     #if _MSC_VER < 1900

-- 
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