From 718844acb9a1a96db05519166e732f4c2dde91b7 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Mon, 9 Feb 2015 20:44:12 +0100 Subject: added a CRAWLER_UNUSED for lua specific module initialization code fixed to comile without WITH_flags (continued) --- include/util/Noreturn.hpp | 2 +- include/util/Unused.hpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 include/util/Unused.hpp (limited to 'include') diff --git a/include/util/Noreturn.hpp b/include/util/Noreturn.hpp index 9f9862c..a3e3004 100644 --- a/include/util/Noreturn.hpp +++ b/include/util/Noreturn.hpp @@ -1,7 +1,7 @@ #ifndef __NORETURN_H_ #define __NORETURN_H -#ifdef __GNUC__ +#if defined( __GNUC__ ) #define CRAWLER_NORETURN __attribute__((noreturn)) #else #define CRAWLER_NORETURN diff --git a/include/util/Unused.hpp b/include/util/Unused.hpp new file mode 100644 index 0000000..e04a8cf --- /dev/null +++ b/include/util/Unused.hpp @@ -0,0 +1,12 @@ +#ifndef __UNUSED_H +#define __UNUSED_H + +#if defined( __GNUC__ ) +#define CRAWLER_UNUSED( x ) x __attribute__( ( unused ) ) +#elif defined( __MSVC__ ) +#define CRAWLER_UNUSED( x ) __pragma( warning( suppress: 4100 4101 ) ) x +#else +#define CRAWLER_UNUSED( x ) x +#endif + +#endif -- cgit v1.2.3-54-g00ecf