diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-05-04 14:33:51 +0300 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-05-04 14:33:51 +0300 |
commit | 7774ae2f8c2dca9ab2d93082856f031e78a1b5f0 (patch) | |
tree | 8e8fa498d6285532b14dc6fc549a7a3089e13e1f /include/conts/conts.h | |
parent | 5a4cb1b5a8ba258a23a62feab1e66cc7d0eba3bf (diff) | |
download | conts-7774ae2f8c2dca9ab2d93082856f031e78a1b5f0.tar.gz conts-7774ae2f8c2dca9ab2d93082856f031e78a1b5f0.zip |
Diffstat (limited to 'include/conts/conts.h')
-rw-r--r-- | include/conts/conts.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/include/conts/conts.h b/include/conts/conts.h index d175d30..fb0094b 100644 --- a/include/conts/conts.h +++ b/include/conts/conts.h @@ -7,16 +7,8 @@ #define CONTAINER_OF(ptr, type, member) \ (type *)((char *)(ptr) - offsetof(type, member)) -#if __STDC_VERSION__ >= 202311UL -# define CONTS_AUTO auto -#elif defined(__GNUC__) -# define CONTS_AUTO __auto_type -#else -# warning "iteration won't work with this compiler" -#endif - #define foreach(name, i, s)\ - for (CONTS_AUTO i = CONTS_JOIN(name, begin)(s);\ + for (CONTS_JOIN(name, iter) i = CONTS_JOIN(name, begin)(s);\ !CONTS_JOIN(name, end)(s, i);\ i = CONTS_JOIN(name, next)(i)) #endif /* CONTS_H */ |