diff options
author | Underground78 <underground78@users.sourceforge.net> | 2012-05-19 20:17:33 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2012-05-19 20:17:33 +0400 |
commit | 62027be3b2b59998a50b50d7be184676f2a90f15 (patch) | |
tree | 16ec7654489faaacf8a5a38934f3e1abcf4b172e /src/DSUtil/DSUtil.h | |
parent | 0aeeed3651f2c235b64b0cdbd3e5a27143208d11 (diff) |
Use Microsoft's _countof macro when it exists since its C++ implementation is safer than just doing sizeof(array)/sizeof(array[0])
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4801 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/DSUtil/DSUtil.h')
-rw-r--r-- | src/DSUtil/DSUtil.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/DSUtil/DSUtil.h b/src/DSUtil/DSUtil.h index 772e3e13f..0df494032 100644 --- a/src/DSUtil/DSUtil.h +++ b/src/DSUtil/DSUtil.h @@ -210,7 +210,9 @@ template <typename T> __inline void INITDDSTRUCT(T& dd) dd.dwSize = sizeof(dd);
}
-#define countof(array) (sizeof(array)/sizeof(array[0]))
+#ifndef _countof
+#define _countof(array) (sizeof(array)/sizeof(array[0]))
+#endif
template <class T>
static CUnknown* WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT* phr)
|