aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConstants.h
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-06-11 20:34:33 +0200
committerMax <post@wickenrode.com>2015-06-11 20:37:04 +0200
commit658e61b113db99d65bebd22a767e06a43d52a240 (patch)
treec89d52de492be897d3b4587fffcb867eda08f48c /Source/SPConstants.h
parent4a11179260951f597cf52d86581d68cd8a98b68d (diff)
downloadsequelpro-658e61b113db99d65bebd22a767e06a43d52a240.tar.gz
sequelpro-658e61b113db99d65bebd22a767e06a43d52a240.tar.bz2
sequelpro-658e61b113db99d65bebd22a767e06a43d52a240.zip
Fix a rare crash when SSH connections failed (caused by a race condition) (fixes #2132)
Diffstat (limited to 'Source/SPConstants.h')
-rw-r--r--Source/SPConstants.h3
1 files changed, 3 insertions, 0 deletions
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])))))