]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FreeTDM: Add ftdm_unused_arg() macro to silence "unused parameter" compiler warnings
authorStefan Knoblich <stkn@openisdn.net>
Mon, 6 May 2013 15:41:50 +0000 (17:41 +0200)
committerStefan Knoblich <stkn@openisdn.net>
Mon, 6 May 2013 15:50:10 +0000 (17:50 +0200)
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
libs/freetdm/src/include/ftdm_os.h

index c34810d241338ca95ce7cb2f7c74ca1bb32ee133..f2adc8742af4e09777bd614f7c684f933f6717ee 100644 (file)
@@ -130,6 +130,18 @@ typedef uint64_t ftdm_time_t;
  */
 #define ftdm_container_of(ptr,type,member) (type *)((uintptr_t)(ptr) - ftdm_offset_of(type, member))
 
+/*!
+ * \brief Silence "unused parameter" compiler warnings
+ * \note Tested with VS 2010, GCC 4.8, clang 3.1 and suncc
+ * \code
+ *     int example(char *a) {
+ *             ftdm_unused_arg(a);
+ *             return 0;
+ *     }
+ * \endcode
+ */
+#define ftdm_unused_arg(x) (void)(x)
+
 
 /*! \brief The memory handler. 
     Do not use directly this variable, use the memory macros and ftdm_global_set_memory_handler to override */