Initial
This commit is contained in:
commit
4433f2dd84
28
mccu/include/lambda.h
Normal file
28
mccu/include/lambda.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#ifndef _H_MCORANGE_LAMBDA
|
||||
#define _H_MCORANGE_LAMBDA
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__MC_LMBD_DEF)
|
||||
#define __MC_LMBD_DEF
|
||||
#error "msc TODO"
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) && !defined(__MC_LMBD_DEF)
|
||||
#if !__has_extension(blocks)
|
||||
#error "Clang blocks feature is required, compile with '-fblocks -lBlocksRuntime' \
|
||||
and make sure you have libblocksruntime(-dev) installed"
|
||||
#endif
|
||||
|
||||
#define __MC_LMBD_DEF
|
||||
#define lambda(ret_t, args_t, body) ( ^ ret_t args_t body )
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__MC_LMBD_DEF)
|
||||
#define __MC_LMBD_DEF
|
||||
#define lambda(ret_t, args_t, body) ({ ret_t lambda##__LINE__ args_t body &lambda##__LINE__; })
|
||||
#endif
|
||||
|
||||
#if !defined(__MC_LMBD_DEF)
|
||||
#error "Unsupported compiler"
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user