#ifndef __UTILITIES__
#define __UTILITIES__
#ifdef __cplusplus
extern "C" {
#endif
#include <CoreFoundation/CoreFoundation.h>
#include "SecCFRelease.h"
void MyDispatchAsync(dispatch_queue_t queue, void(^block)(void));
dispatch_queue_t MyDispatchQueueCreate(const char* name, dispatch_queue_attr_t attr);
CFErrorRef CreateGenericErrorRef(CFStringRef domain, int errorCode, const char* format, ...);
CFErrorRef CreateSecTransformErrorRef(int errorCode, const char* format, ...);
CFErrorRef CreateSecTransformErrorRefWithCFType(int errorCode, CFTypeRef errorMsg);
CFTypeRef DebugRetain(const void* owner, CFTypeRef type);
void DebugRelease(const void* owner, CFTypeRef type);
void transforms_bug(size_t line, long val) __attribute__((__noinline__));
#define fastpath(x) ((typeof(x))__builtin_expect((long)(x), ~0l))
#define slowpath(x) ((typeof(x))__builtin_expect((long)(x), 0l))
#define transforms_assume(e) ({ \
typeof(e) _e = fastpath(e); \
if (!_e) { \
if (__builtin_constant_p(e)) { \
char __compile_time_assert__[(e) ? 1 : -1]; \
(void)__compile_time_assert__; \
} \
transforms_bug(__LINE__, (long)_e); \
} \
_e; \
})
#define transforms_assume_zero(e) ({ \
typeof(e) _e = slowpath(e); \
if (_e) { \
if (__builtin_constant_p(e)) { \
char __compile_time_assert__[(e) ? -1 : 1]; \
(void)__compile_time_assert__; \
} \
transforms_bug(__LINE__, (long)_e); \
} \
_e; \
})
#ifdef __cplusplus
};
#endif
#endif