diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-02-09 17:26:28 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-02-09 17:26:28 +0300 |
commit | ff4dc7abfad6f4dc0f14ae158544f69ee981b7fe (patch) | |
tree | 5069aae1901aef4cee4750dc8e1c322538139701 /source/blender/blenlib/BLI_iterator.h | |
parent | 0b473168cd291615d81ad31ce8254a90ce4f2738 (diff) |
Change ITER_BEGIN to work in C++ (include object type in the macro)
Diffstat (limited to 'source/blender/blenlib/BLI_iterator.h')
-rw-r--r-- | source/blender/blenlib/BLI_iterator.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_iterator.h b/source/blender/blenlib/BLI_iterator.h index cfa303bb1cd..d154b81ac82 100644 --- a/source/blender/blenlib/BLI_iterator.h +++ b/source/blender/blenlib/BLI_iterator.h @@ -36,7 +36,7 @@ typedef struct Iterator { typedef void (*IteratorCb)(Iterator *iter); typedef void (*IteratorBeginCb)(Iterator *iter, void *data_in); -#define ITER_BEGIN(callback_begin, callback_next, callback_end, _data_in, _data_out) \ +#define ITER_BEGIN(callback_begin, callback_next, callback_end, _data_in, _type, _data_out) \ { \ IteratorCb callback_end_func = callback_end; \ Iterator iter_macro; \ @@ -44,7 +44,7 @@ typedef void (*IteratorBeginCb)(Iterator *iter, void *data_in); iter_macro.valid; \ callback_next(&iter_macro)) \ { \ - _data_out = iter_macro.current; + _data_out = (_type *) iter_macro.current; #define ITER_END \ } \ |