[mlpack-git] master: Add DEPRECATED macro. (1753f25)

gitdub at mlpack.org gitdub at mlpack.org
Tue Aug 23 15:58:25 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/1148f1652e139c9037eb3813550090313d089a30...a8a8a1381b529a01420de6e792a4a1e7bd58a626

>---------------------------------------------------------------

commit 1753f259fafa1f311ffe7c54f49695519ee7a739
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Mon Aug 15 13:24:28 2016 -0300

    Add DEPRECATED macro.


>---------------------------------------------------------------

1753f259fafa1f311ffe7c54f49695519ee7a739
 src/mlpack/core.hpp                 |  1 +
 src/mlpack/core/util/CMakeLists.txt |  1 +
 src/mlpack/core/util/deprecated.hpp | 19 +++++++++++++++++++
 3 files changed, 21 insertions(+)

diff --git a/src/mlpack/core.hpp b/src/mlpack/core.hpp
index e3c8f89..1d3d6a3 100644
--- a/src/mlpack/core.hpp
+++ b/src/mlpack/core.hpp
@@ -203,6 +203,7 @@
 #include <mlpack/core/util/arma_traits.hpp>
 #include <mlpack/core/util/log.hpp>
 #include <mlpack/core/util/cli.hpp>
+#include <mlpack/core/util/deprecated.hpp>
 #include <mlpack/core/data/load.hpp>
 #include <mlpack/core/data/save.hpp>
 #include <mlpack/core/data/normalize_labels.hpp>
diff --git a/src/mlpack/core/util/CMakeLists.txt b/src/mlpack/core/util/CMakeLists.txt
index e75b2cb..b7830b1 100644
--- a/src/mlpack/core/util/CMakeLists.txt
+++ b/src/mlpack/core/util/CMakeLists.txt
@@ -10,6 +10,7 @@ set(SOURCES
   cli_deleter.hpp
   cli_deleter.cpp
   cli_impl.hpp
+  deprecated.hpp
   log.hpp
   log.cpp
   nulloutstream.hpp
diff --git a/src/mlpack/core/util/deprecated.hpp b/src/mlpack/core/util/deprecated.hpp
new file mode 100644
index 0000000..ce31acc
--- /dev/null
+++ b/src/mlpack/core/util/deprecated.hpp
@@ -0,0 +1,19 @@
+/**
+ * @file deprecated.hpp
+ * @author Marcos Pividori.
+ *
+ * Definition of the DEPRECATED macro.
+ */
+#ifndef MLPACK_CORE_UTIL_DEPRECATED_HPP
+#define MLPACK_CORE_UTIL_DEPRECATED_HPP
+
+#ifdef __GNUG__
+#define DEPRECATED __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#define DEPRECATED __declspec(deprecated)
+#else
+#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
+#define DEPRECATED
+#endif
+
+#endif




More information about the mlpack-git mailing list