Daniel Lehman : include: Add _countof macro.

Alexandre Julliard julliard at winehq.org
Tue May 1 15:15:45 CDT 2018


Module: wine
Branch: master
Commit: 1ce735649820cf1526d3cb7e6af98361a406b52b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1ce735649820cf1526d3cb7e6af98361a406b52b

Author: Daniel Lehman <dlehman at esri.com>
Date:   Thu Sep  1 10:27:40 2016 -0700

include: Add _countof macro.

Signed-off-by: Daniel Lehman <dlehman at esri.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/msvcrt/stdlib.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h
index 174df43..892f36a 100644
--- a/include/msvcrt/stdlib.h
+++ b/include/msvcrt/stdlib.h
@@ -60,6 +60,9 @@ typedef struct _ldiv_t {
     __msvcrt_long rem;
 } ldiv_t;
 
+
+#define _countof(x) (sizeof(x)/sizeof((x)[0]))
+
 #define __max(a,b) (((a) > (b)) ? (a) : (b))
 #define __min(a,b) (((a) < (b)) ? (a) : (b))
 #ifndef __cplusplus




More information about the wine-cvs mailing list