[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    [PATCH] include: Add _countof macro.
From:       Daniel Lehman <dlehman () esri ! com>
Date:       2018-04-30 20:46:27
Message-ID: 1771d2ff24af419895f58ee7cb74f910 () RED-INF-MXMB-P4 ! esri ! com
[Download RAW message or body]

["0001-include-Add-_countof-macro.txt" (text/plain)]

From f80cf7cd9bd05e53c278cd432caf98a63e2e3011 Mon Sep 17 00:00:00 2001
From: Daniel Lehman <dlehman@esri.com>
Date: Thu, 1 Sep 2016 10:27:40 -0700
Subject: [PATCH] include: Add _countof macro.

Signed-off-by: Daniel Lehman <dlehman@esri.com>
---
 include/msvcrt/stdlib.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h
index 2c213ac8d84..a3251878b0d 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
-- 
2.17.0


[Attachment #4 (text/plain)]




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic