LuaAutoC icon indicating copy to clipboard operation
LuaAutoC copied to clipboard

replace nested functions with blocks on clang

Open cute opened this issue 9 years ago • 6 comments

cute avatar Jul 14 '16 05:07 cute

Thanks this looks great :+1: Can you put it behind another processor flag as well as __clang__? Some people may either be using clang already with nested functions or not want this behaviour.

orangeduck avatar Jul 14 '16 07:07 orangeduck

Are there any updates on this PR?

XVilka avatar Nov 28 '17 03:11 XVilka

Are you interested in using clang blocks for your own project? I can merge this in if there is some interest - just need to add an extra pre-processor flag to guard it.

orangeduck avatar Nov 29 '17 00:11 orangeduck

FWIW, clang doesn't support GCC-style nested functions at all, so there wouldn't be anybody using clang with LuaAutoC from what I can tell. Thus there wouldn't be a need for an additional guard. Using blocks might be the only way to get it building on clang.

sjml avatar Jul 08 '19 11:07 sjml

You can use clang with LuaAutoC you just need to have separate declaration and registration functions as mentioned in the FAQ under "nested functions": https://github.com/orangeduck/LuaAutoC#faq but yes in general in clang you need to use blocks instead of nested functions.

orangeduck avatar Jul 08 '19 22:07 orangeduck

Ah, yes, my bad. Sorry I spoke overly-definitively!

sjml avatar Jul 09 '19 04:07 sjml