1.1 --- a/templates/ops.h Sat Feb 18 18:52:04 2017 +0100
1.2 +++ b/templates/ops.h Sat Feb 18 20:13:47 2017 +0100
1.3 @@ -70,9 +70,13 @@
1.4
1.5 /* Context-related operations. */
1.6
1.7 +int __test_context_update(__ref context, __attr attr);
1.8 __attr __test_context(__ref context, __attr attr);
1.9 __attr __update_context(__ref context, __attr attr);
1.10
1.11 +#define __test_context_set(__TARGET, __CONTEXT, __ATTR) \
1.12 + (__test_context_update(__CONTEXT, __ATTR) ? (__set_context(__TARGET, (__attr) {.value=__CONTEXT}), __ATTR) : __ATTR)
1.13 +
1.14 #define __get_context(__TARGET) (__tmp_contexts[__TARGET])
1.15 #define __set_context(__TARGET, __ATTR) (__tmp_contexts[__TARGET] = (__ATTR).value)
1.16 #define __set_private_context(__ATTR) (__tmp_private_context = (__ATTR).value)