summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/misc.h b/misc.h
index 303c29c..b6a1b86 100644
--- a/misc.h
+++ b/misc.h
@@ -72,11 +72,13 @@ struct CompileAssert
// ************** counting elements in an array ***************
// VS2005 added _countof macro, fails on pointers
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-# define COUNTOF(x) _countof(x)
-#else
-# define COUNTOF(x) (sizeof(x)/sizeof(x[0]))
-#endif
+#ifndef COUNTOF
+# if defined(_MSC_VER) && (_MSC_VER >= 1400)
+# define COUNTOF(x) _countof(x)
+# else
+# define COUNTOF(x) (sizeof(x)/sizeof(x[0]))
+# endif
+#endif // COUNTOF
// ************** misc classes ***************