aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Elliott <ian@LunarG.com>2015-02-25 17:40:38 -0700
committerIan Elliott <ian@LunarG.com>2015-02-25 17:40:38 -0700
commitc88216fef874eb08a085265184826c6809da40ff (patch)
treedafc80c8340820dc7299137f63aa639271506ae7
parent154fe636ee893b6835c2b8f9a8f2bfc0432c7067 (diff)
downloadusermoji-c88216fef874eb08a085265184826c6809da40ff.tar.xz
Win: Fix compilation error on Windows (xgl_helper.py).
Visual Studio doesn't like the following code construct: if (<some test>) return <something>; <type> variable [= <intial-value>]; We have to use curly-braces, as in: if (<some test>) { return <something>; } <type> variable [= <intial-value>];
-rwxr-xr-xxgl_helper.py6
1 files 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;')