summaryrefslogtreecommitdiff
path: root/src/cc-compat.h
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2012-01-24 14:06:42 -0800
committerRussell Belfer <arrbee@arrbee.com>2012-03-02 15:49:28 -0800
commit2705576bfa90675433be49a4141cfdd867e380cc (patch)
treeaf4f390de70585a426df45b7e92a141b9d08227e /src/cc-compat.h
parent3a5ad90a0de4408c2754763fe1ced0da984bae6e (diff)
downloadlibgit2-2705576bfa90675433be49a4141cfdd867e380cc.tar.gz
Simplify GIT_UNUSED macros
Since casting to void works to eliminate errors with unused parameters on all platforms, avoid the various special cases. Over time, it will make sense to eliminate the GIT_UNUSED macro completely and just have GIT_UNUSED_ARG.
Diffstat (limited to 'src/cc-compat.h')
-rw-r--r--src/cc-compat.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/cc-compat.h b/src/cc-compat.h
index 29cc2ec6a..bbccd1f55 100644
--- a/src/cc-compat.h
+++ b/src/cc-compat.h
@@ -33,21 +33,8 @@
# define GIT_TYPEOF(x)
#endif
-#ifdef __cplusplus
-# define GIT_UNUSED(x)
-#else
-# ifdef __GNUC__
-# define GIT_UNUSED(x) x __attribute__ ((__unused__))
-# else
-# define GIT_UNUSED(x) x
-# endif
-#endif
-
-#if defined(_MSC_VER)
-#define GIT_UNUSED_ARG(x) ((void)(x)); /* note trailing ; */
-#else
-#define GIT_UNUSED_ARG(x)
-#endif
+#define GIT_UNUSED(x) x
+#define GIT_UNUSED_ARG(x) ((void)(x))
/* Define the printf format specifer to use for size_t output */
#if defined(_MSC_VER) || defined(__MINGW32__)