diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-07-14 21:12:37 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-07-14 21:12:37 +0200 |
commit | 30740ca4131d1f574718262451b4410207dc8d4e (patch) | |
tree | fc88b16a216079397ad85b9c6b1a1c1c5712a814 /source/kit/defer.h | |
parent | 5e3c99bb1cf1d03ea006300121265571f5008fd2 (diff) | |
download | saw-30740ca4131d1f574718262451b4410207dc8d4e.zip |
Reworking the build system
Diffstat (limited to 'source/kit/defer.h')
-rw-r--r-- | source/kit/defer.h | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/source/kit/defer.h b/source/kit/defer.h deleted file mode 100644 index bb78b69..0000000 --- a/source/kit/defer.h +++ /dev/null @@ -1,39 +0,0 @@ -// Requres GCC or Clang with `-fblocks` option available. -// - -#ifndef KIT_DEFER_H -#define KIT_DEFER_H - -#if !defined(__clang__) && !defined(__APPLE__) -# error C blocks support required -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__GNUC__) || defined(__clang__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-function" -# pragma GCC diagnostic ignored "-Wunknown-pragmas" -#endif - -static void kit_defer_cleanup_(void (^*b)(void)) { (*b)(); } - -#define kit_defer_merge_(a,b) a##b -#define kit_defer_varname_(a) \ - kit_defer_merge_(kit_defer_scopevar_,a) -#define defer \ - __attribute__((unused, cleanup(kit_defer_cleanup_))) \ - void (^kit_defer_varname_(__COUNTER__))(void) = ^ -#define defer_ref __block - -#if defined(__GNUC__) || defined(__clang__) -# pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif |