path: root/src/mesa/drivers/dri/common/xmlpool.h
diff options
authorEric Anholt <>2013-01-02 17:02:58 -0800
committerEric Anholt <>2013-04-19 10:10:22 -0700
commitea6cf2b68614e9f8d0db44ee917ce93f9ad1ac2f (patch)
tree8d95c5977b88d1b9c8f0116bd5aef8090e9f5a5e /src/mesa/drivers/dri/common/xmlpool.h
parentcecbfce5ebdd4547e5c6f56b3f669dac3e6df82a (diff)
mesa: Use quotes on bool driconf options to prevent stdbool.h breakage.
Since stdbool.h's "true" and "false" are #defines, they got expanded when used as macro arguments, and that expanded value was stored in the XML string, producing XML that driconf would then fail to parse. Currently no drivers included stdbool along with driconf, but I keep accidentally doing so on intel as we move towards using normal C. v2: rebase on master. Reviewed-by: Kenneth Graunke <> (v1)
Diffstat (limited to 'src/mesa/drivers/dri/common/xmlpool.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/xmlpool.h b/src/mesa/drivers/dri/common/xmlpool.h
index ffea430024..ebd4e7c863 100644
--- a/src/mesa/drivers/dri/common/xmlpool.h
+++ b/src/mesa/drivers/dri/common/xmlpool.h
@@ -60,6 +60,13 @@
#define DRI_CONF_OPT_BEGIN(name,type,def) \
"<option name=\""#name"\" type=\""#type"\" default=\""#def"\">\n"
+ * \brief Begin a boolean option definition, with the default value passed in
+ * as a string
+ */
+#define DRI_CONF_OPT_BEGIN_B(name,def) \
+"<option name=\""#name"\" type=\"bool\" default="#def">\n"
/** \brief Begin an option definition with quoted default value */
#define DRI_CONF_OPT_BEGIN_Q(name,type,def) \
"<option name=\""#name"\" type=\""#type"\" default="#def">\n"