Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

OOO_STATIC_ASSERT

  • Loading branch information...
commit 744aac01ee3f1f52c4c1c3d22e892762fc5219bf 1 parent 821e18e
@tconkling tconkling authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 Classes/OOOMacros.h
View
7 Classes/OOOMacros.h
@@ -1,6 +1,10 @@
//
// cooocoa - Copyright 2012 Three Rings Design
+/// Helpers
+#define OOO_CONCAT_TOKENS(a, b) a ## b
+#define OOO_EXPAND_THEN_CONCAT(a,b) OOO_CONCAT_TOKENS(a, b)
+
/// Returns an NSMutableArray containing a method's varargs
/// -(NSArray*)toArray:(Foo*)obj1, ... { return OOO_VARARGS_TO_ARRAY(Foo*, obj1); }
#define OOO_VARARGS_TO_ARRAY(type, first) ({ \
@@ -36,3 +40,6 @@
[NSException raise:NSInternalInconsistencyException \
format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; \
})
+
+/// Compile-time assertion
+#define OOO_STATIC_ASSERT(e) enum { OOO_EXPAND_THEN_CONCAT(ASSERT_line_,__LINE__) = 1/!!(e) }
Please sign in to comment.
Something went wrong with that request. Please try again.