Skip to content

Commit

Permalink
Add assert define
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Oct 3, 2023
1 parent d3ec76b commit 4a5b987
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions include/macrOS/baseMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@
#define macrOS_NOT_COMMONLY_CALLED macrOS_MINSIZE macrOS_COLD macrOS_NEVER_INLINE
#endif

#ifndef macrOS_ASSERT
#define macrOS_ASSERT(x) assert(x)
#endif

#endif /* macrOS_BASE_MACROS_H */
4 changes: 2 additions & 2 deletions include/macrOS/macrOSObjC.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ BOOL wrapper_addClassMethod(Class class, SEL name, IMP imp, const char* types);
/* Check here to get the signature right: https://nshipster.com/type-encodings/ */
#define addMethod(CLASS, NAME, IMPL, SIGNATURE) \
if (!addMethodToClass_wrapper(CLASS, sel(NAME), (IMP)(IMPL), (SIGNATURE))) \
assert(false)
macrOS_ASSERT(false)

#define addIvar(CLASS, NAME, SIZE, SIGNATURE) \
if (!class_addIvar(CLASS, NAME, SIZE, rint(log2(SIZE)), SIGNATURE)) \
assert(false)
macrOS_ASSERT(false)

/* Convenience macros to call Objective C functions which may have specialised implementations.
id objc_alloc(Class class): Equivalent to [Class alloc]
Expand Down

0 comments on commit 4a5b987

Please sign in to comment.