Daniel Lehman : include: Add _countof macro.
Module: wine Branch: master Commit: 1ce735649820cf1526d3cb7e6af98361a406b52b URL: https://source.winehq.org/git/wine.git/?a=commit;h=1ce735649820cf1526d3cb7e6... Author: Daniel Lehman <dlehman(a)esri.com> Date: Thu Sep 1 10:27:40 2016 -0700 include: Add _countof macro. Signed-off-by: Daniel Lehman <dlehman(a)esri.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)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
participants (1)
-
Alexandre Julliard