diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2010-04-22 18:19:39 +0100 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2010-04-23 21:57:49 +0100 |
commit | 89aaaab79f407dd691e0a98167f48a0860ec791a (patch) | |
tree | e7c10b5e09ff0584c72b9469c867bde637f87754 /src/gallium | |
parent | 7159303dbf5ae4023e41dd188f3391807f5b892b (diff) |
gallium: Add static get option helpers
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/util/u_debug.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h index b6d0b508e3..ec3371a9b2 100644 --- a/src/gallium/auxiliary/util/u_debug.h +++ b/src/gallium/auxiliary/util/u_debug.h @@ -303,6 +303,39 @@ debug_get_flags_option(const char *name, const struct debug_named_value *flags, unsigned long dfault); +#define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \ +static boolean \ +debug_get_option_ ## sufix (void) \ +{ \ + static boolean first = TRUE; \ + static boolean value; \ + if (first && !(first = FALSE)) \ + value = debug_get_bool_option(name, dfault); \ + return value; \ +} + +#define DEBUG_GET_ONCE_NUM_OPTION(sufix, name, dfault) \ +static long \ +debug_get_option_ ## sufix (void) \ +{ \ + static boolean first = TRUE; \ + static long value; \ + if (first && !(first = FALSE)) \ + value = debug_get_num_option(name, dfault); \ + return value; \ +} + +#define DEBUG_GET_ONCE_FLAGS_OPTION(sufix, name, flags, dfault) \ +static unsigned long \ +debug_get_option_ ## sufix (void) \ +{ \ + static boolean first = TRUE; \ + static unsigned long value; \ + if (first && !(first = FALSE)) \ + value = debug_get_flags_option(name, flags, dfault); \ + return value; \ +} + unsigned long debug_memory_begin(void); |