[arrayfire] 07/79: Move snprintf/static macros from defines.h to backend

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Jun 15 13:38:02 UTC 2015


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

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

commit 02d9076cc5d2682b7cd04129d97a5015f62cf47e
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Thu Jun 4 12:13:16 2015 -0400

    Move snprintf/static macros from defines.h to backend
---
 include/af/defines.h          |  6 ------
 src/backend/ArrayInfo.hpp     |  1 +
 src/backend/cpu/math.cpp      |  1 +
 src/backend/cuda/math.hpp     |  1 +
 src/backend/defines.hpp       | 21 +++++++++++++++++++++
 src/backend/opencl/traits.hpp |  1 +
 6 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/include/af/defines.h b/include/af/defines.h
index a0ec713..f04da32 100644
--- a/include/af/defines.h
+++ b/include/af/defines.h
@@ -25,17 +25,11 @@
         #define true  1
     #endif
     #define __PRETTY_FUNCTION__ __FUNCSIG__
-    #if _MSC_VER < 1900
-	    #define snprintf sprintf_s
-    #endif
-    #define STATIC_ static
     #define SIZE_T_FRMT_SPECIFIER "%Iu"
     #define DEPRECATED(msg) __declspec(deprecated( msg ))
 #else
     #define AFAPI   __attribute__((visibility("default")))
     #include <stdbool.h>
-    #define __PRETTY_FUNCTION__ __func__
-    #define STATIC_ inline
     #define SIZE_T_FRMT_SPECIFIER "%zu"
 #if __GNUC__ >= 4 && __GNUC_MINOR > 4
     #define DEPRECATED(msg) __attribute__((deprecated( msg )))
diff --git a/src/backend/ArrayInfo.hpp b/src/backend/ArrayInfo.hpp
index b798051..f89aa98 100644
--- a/src/backend/ArrayInfo.hpp
+++ b/src/backend/ArrayInfo.hpp
@@ -8,6 +8,7 @@
  ********************************************************/
 
 #pragma once
+#include <defines.hpp>
 #include <af/array.h>
 #include <af/util.h>
 #include <af/dim4.hpp>
diff --git a/src/backend/cpu/math.cpp b/src/backend/cpu/math.cpp
index 1bff417..12a126b 100644
--- a/src/backend/cpu/math.cpp
+++ b/src/backend/cpu/math.cpp
@@ -6,6 +6,7 @@
  * The complete license agreement can be obtained at:
  * http://arrayfire.com/licenses/BSD-3-Clause
  ********************************************************/
+#include <defines.hpp>
 #include <math.hpp>
 
 namespace cpu
diff --git a/src/backend/cuda/math.hpp b/src/backend/cuda/math.hpp
index 20301fd..3f7dcd4 100644
--- a/src/backend/cuda/math.hpp
+++ b/src/backend/cuda/math.hpp
@@ -9,6 +9,7 @@
 
 #pragma once
 #include <af/defines.h>
+#include <defines.hpp>
 #include <limits>
 #include <algorithm>
 #include "backend.hpp"
diff --git a/src/backend/defines.hpp b/src/backend/defines.hpp
new file mode 100644
index 0000000..2689837
--- /dev/null
+++ b/src/backend/defines.hpp
@@ -0,0 +1,21 @@
+/*******************************************************
+ * 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
+
+#if defined(_WIN32) || defined(_MSC_VER)
+    #define __PRETTY_FUNCTION__ __FUNCSIG__
+    #if _MSC_VER < 1900
+        #define snprintf sprintf_s
+    #endif
+    #define STATIC_ static
+#else
+    #define __PRETTY_FUNCTION__ __func__
+    #define STATIC_ inline
+#endif
diff --git a/src/backend/opencl/traits.hpp b/src/backend/opencl/traits.hpp
index 71a51c9..c483fbf 100644
--- a/src/backend/opencl/traits.hpp
+++ b/src/backend/opencl/traits.hpp
@@ -9,6 +9,7 @@
 
 #pragma once
 
+#include <defines.hpp>
 #include <af/traits.hpp>
 #include <string>
 #include <sstream>

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