From c88216fef874eb08a085265184826c6809da40ff Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Wed, 25 Feb 2015 17:40:38 -0700 Subject: Win: Fix compilation error on Windows (xgl_helper.py). Visual Studio doesn't like the following code construct: if () return ; variable [= ]; We have to use curly-braces, as in: if () { return ; } variable [= ]; --- xgl_helper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xgl_helper.py b/xgl_helper.py index 6b6a1d1c..a4cf2377 100755 --- a/xgl_helper.py +++ b/xgl_helper.py @@ -615,8 +615,9 @@ class StructWrapperGen: # Add function to dynamically print out unknown struct sh_funcs.append("char* dynamic_display(const void* pStruct, const char* prefix)\n{\n") sh_funcs.append(" // Cast to APP_INFO ptr initially just to pull sType off struct\n") - sh_funcs.append(" if (pStruct == NULL)\n") + sh_funcs.append(" if (pStruct == NULL) {\n") sh_funcs.append(" return NULL;\n") + sh_funcs.append(" }\n") sh_funcs.append(" XGL_STRUCTURE_TYPE sType = ((XGL_APPLICATION_INFO*)pStruct)->sType;\n") sh_funcs.append(' char indent[100];\n strcpy(indent, " ");\n strcat(indent, prefix);\n') sh_funcs.append(" switch (sType)\n {\n") @@ -760,8 +761,9 @@ class StructWrapperGen: # Add function to dynamically print out unknown struct sh_funcs.append("string dynamic_display(const void* pStruct, const string prefix)\n{") sh_funcs.append(" // Cast to APP_INFO ptr initially just to pull sType off struct") - sh_funcs.append(" if (pStruct == NULL)") + sh_funcs.append(" if (pStruct == NULL) {\n") sh_funcs.append(" return NULL;") + sh_funcs.append(" }\n") sh_funcs.append(" XGL_STRUCTURE_TYPE sType = ((XGL_APPLICATION_INFO*)pStruct)->sType;") sh_funcs.append(' string indent = " ";') sh_funcs.append(' indent += prefix;') -- cgit v1.2.3