diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-09-02 12:18:51 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-09-02 12:18:51 +0200 |
commit | 553f808fc4986818e820a76fa267c90a660d41c2 (patch) | |
tree | 29c5f127a31d3c6f210be6515666d9c5811af17e /src | |
parent | 21b3220cdbb17fb3ee3dc999909ec6bc9e77df44 (diff) | |
download | crawler-553f808fc4986818e820a76fa267c90a660d41c2.tar.gz crawler-553f808fc4986818e820a76fa267c90a660d41c2.tar.bz2 |
fixed a noreturn warning in the Singleton
Diffstat (limited to 'src')
-rw-r--r-- | src/Noreturn.hpp | 11 | ||||
-rwxr-xr-x | src/Singleton.hpp | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/Noreturn.hpp b/src/Noreturn.hpp new file mode 100644 index 0000000..9f9862c --- /dev/null +++ b/src/Noreturn.hpp @@ -0,0 +1,11 @@ +#ifndef __NORETURN_H_ +#define __NORETURN_H + +#ifdef __GNUC__ +#define CRAWLER_NORETURN __attribute__((noreturn)) +#else +#define CRAWLER_NORETURN +#endif + +#endif + diff --git a/src/Singleton.hpp b/src/Singleton.hpp index 39b89e8..1bfb460 100755 --- a/src/Singleton.hpp +++ b/src/Singleton.hpp @@ -4,6 +4,7 @@ #include "ScopedPtr.hpp" #include "NonCopyable.hpp" #include "Exportable.hpp" +#include "Noreturn.hpp" #include <cstdlib> #include <stdexcept> @@ -48,7 +49,7 @@ class Singleton : private noncopyable t.reset( new T ); } - static void onDeadReference( ) + static void onDeadReference( ) CRAWLER_NORETURN { throw std::runtime_error( "singleton has already been destroyed!" ); } |