]> git.proxmox.com Git - libgit2.git/blobdiff - src/cc-compat.h
New upstream version 1.3.0+dfsg.1
[libgit2.git] / src / cc-compat.h
index 7ade561f3def5b31dd253e6bfd7054aa4b05fbdd..f701b2d9351912e6259e9ae8a4107915f597a896 100644 (file)
 #      endif
 #endif
 
-#ifdef __GNUC__
-#      define GIT_TYPEOF(x) (__typeof__(x))
-#else
-#      define GIT_TYPEOF(x)
-#endif
-
 #if defined(__GNUC__)
 #      define GIT_ALIGN(x,size) x __attribute__ ((aligned(size)))
 #elif defined(_MSC_VER)
 #      define GIT_ALIGN(x,size) x
 #endif
 
-#define GIT_UNUSED(x) ((void)(x))
+#if defined(__GNUC__)
+# define GIT_UNUSED(x)                                                         \
+       do {                                                                   \
+               __typeof__(x) _unused __attribute__((unused));                 \
+               _unused = (x);                                                 \
+       } while (0)
+#else
+# define GIT_UNUSED(x) ((void)(x))
+#endif
 
-/* Define the printf format specifer to use for size_t output */
+/* Define the printf format specifier to use for size_t output */
 #if defined(_MSC_VER) || defined(__MINGW32__)
 
 /* Visual Studio 2012 and prior lack PRId64 entirely */