@@ -148,10 +148,13 @@ # define OF_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) #else # define OF_GCC_VERSION 0 #endif +#define OF_STRINGIFY(s) OF_STRINGIFY2(s) +#define OF_STRINGIFY2(s) #s + #ifndef __has_feature # define __has_feature(x) 0 #endif #ifndef __has_attribute @@ -362,14 +365,16 @@ #define OF_RETAIN_COUNT_MAX UINT_MAX #define OF_NOT_FOUND SIZE_MAX #ifdef OBJC_COMPILING_RUNTIME -# define OF_ENSURE(cond) \ - do { \ - if OF_UNLIKELY (!(cond)) \ - OBJC_ERROR("Failed to ensure condition:\n" #cond); \ +# define OF_ENSURE(cond) \ + do { \ + if OF_UNLIKELY (!(cond)) \ + objc_error("ObjFWRT @ " __FILE__ ":" \ + OF_STRINGIFY(__LINE__), \ + "Failed to ensure condition:\n" #cond); \ } while(0) #else # define OF_ENSURE(cond) \ do { \ if OF_UNLIKELY (!(cond)) { \