summaryrefslogtreecommitdiff
path: root/include/asterisk/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/utils.h')
-rw-r--r--include/asterisk/utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index d2db42e07..134caa8dc 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -102,6 +102,14 @@ extern unsigned int __unsigned_int_flags_dummy;
(p)->flags &= ~(flag); \
} while (0)
+#define ast_set_flags_to(p,flag,value) do { \
+ typeof ((p)->flags) __p = (p)->flags; \
+ typeof (__unsigned_int_flags_dummy) __x = 0; \
+ (void) (&__p == &__x); \
+ (p)->flags &= ~(flag); \
+ (p)->flags |= (value); \
+ } while (0)
+
/* Non-type checking variations for non-unsigned int flags. You
should only use non-unsigned int flags where required by
protocol etc and if you know what you're doing :) */