Add DPL_DEPRECATED macro
authorJihoon Chung <jihoon.chung@samsaung.com>
Wed, 9 Oct 2013 06:36:23 +0000 (15:36 +0900)
committerJihoon Chung <jihoon.chung@samsaung.com>
Wed, 9 Oct 2013 09:06:16 +0000 (18:06 +0900)
[Issue#]     N/A
[Problem]    WRT doesn't have any MACRO to show deprecated build warning.
[Cause]      N/A
[Solution]   Add macro for showing build warning. (DPL_DEPRECATED, DPL_DEPRECATED_WITH_MESSAGE(msg))
             - Macro uses gcc attribute
               __attribute__((deprecated)), __attribute__((deprecated("msg")))
               The deprecated attribute results in a warning if the function is used anywhere in the source file.
               This is useful when identifying functions that are expected to be removed in a future version of a program.
               The warning also includes the location of the declaration of the deprecated function,
               to enable users to easily find further information about why the function is deprecated,
               or what they should do instead.
               The deprecated attribute can also be used for variables and types. (Variable Attributes, Type Attributes)
               http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html#Function%20Attributes
[SCMRequest] N/A

Change-Id: I2d79d8cacff3593c2bba8ea048d9a4025c6f4994

modules/core/config.cmake
modules/core/include/dpl/availability.h [new file with mode: 0644]

index 33f25ea..774f8fe 100644 (file)
@@ -85,6 +85,7 @@ SET(DPL_CORE_HEADERS
     ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/assert.h
     ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/atomic.h
     ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/auto_ptr.h
+    ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/availability.h
     ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/binary_queue.h
     ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/bool_operator.h
     ${PROJECT_SOURCE_DIR}/modules/core/include/dpl/char_traits.h
diff --git a/modules/core/include/dpl/availability.h b/modules/core/include/dpl/availability.h
new file mode 100644 (file)
index 0000000..f20c5df
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file        availability.h
+ * @author      Jihoon Chung (jihoon.chung@samsung.com)
+ * @version     1.0
+ */
+#ifndef DPL_AVAILABILITY_H
+#define DPL_AVAILABILITY_H
+
+#define DPL_DEPRECATED __attribute__((deprecated))
+#define DPL_DEPRECATED_WITH_MESSAGE(msg) __attribute__((deprecated(msg)))
+
+#endif // DPL_AVAILABILITY_H