From 658e61b113db99d65bebd22a767e06a43d52a240 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 11 Jun 2015 20:34:33 +0200 Subject: Fix a rare crash when SSH connections failed (caused by a race condition) (fixes #2132) --- Source/SPConstants.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Source/SPConstants.h') diff --git a/Source/SPConstants.h b/Source/SPConstants.h index f81b3fd0..6a8afeea 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -647,3 +647,6 @@ typedef NSUInteger NSCellHitResult; // Stolen from Stack Overflow: http://stackoverflow.com/questions/969130 #define SPLog(fmt, ...) NSLog((@"%s:%d: " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) + +// See http://stackoverflow.com/questions/4415524 +#define COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) -- cgit v1.2.3