summaryrefslogtreecommitdiff
path: root/src/mongo/util/scopeguard.h
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2012-04-11 16:04:22 -0400
committerAndy Schwerin <schwerin@10gen.com>2012-04-12 12:22:05 -0400
commit6ae3906856e44147061a7fe7d60a1e73445ee40a (patch)
tree415c872041ca66e6f4033ca73a2a6c7080a04cf1 /src/mongo/util/scopeguard.h
parente819261720e48699679c511c69f2f82c2c6a94ab (diff)
downloadmongo-6ae3906856e44147061a7fe7d60a1e73445ee40a.tar.gz
Introduce mongo/platform/compiler.h.
Get rid of most uses of __attribute__ and __declspec outside of the platform/compiler headers.
Diffstat (limited to 'src/mongo/util/scopeguard.h')
-rw-r--r--src/mongo/util/scopeguard.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mongo/util/scopeguard.h b/src/mongo/util/scopeguard.h
index 8ced04f47fc..9147e0fc72e 100644
--- a/src/mongo/util/scopeguard.h
+++ b/src/mongo/util/scopeguard.h
@@ -15,6 +15,8 @@
#ifndef LOKI_SCOPEGUARD_H_
#define LOKI_SCOPEGUARD_H_
+#include "mongo/platform/compiler.h"
+
namespace mongo
{
@@ -421,12 +423,9 @@ namespace mongo
#define LOKI_CONCATENATE(s1, s2) LOKI_CONCATENATE_DIRECT(s1, s2)
#define LOKI_ANONYMOUS_VARIABLE(str) LOKI_CONCATENATE(str, __LINE__)
-#ifdef __GNUC__
-#define ON_BLOCK_EXIT ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) __attribute__ ((unused)) = MakeGuard
-#define ON_BLOCK_EXIT_OBJ ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) __attribute__ ((unused)) = MakeObjGuard
-#else
-#define ON_BLOCK_EXIT ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
-#define ON_BLOCK_EXIT_OBJ ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard
-#endif
+#define ON_BLOCK_EXIT \
+ MONGO_COMPILER_VARIABLE_UNUSED ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
+#define ON_BLOCK_EXIT_OBJ \
+ MONGO_COMPILER_VARIABLE_UNUSED ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard
#endif //LOKI_SCOPEGUARD_H_