From 3b8090fcc184d7344980eb3d3a6fce896ffc927c Mon Sep 17 00:00:00 2001 From: erwin coumans Date: Wed, 19 Oct 2016 07:42:55 -0700 Subject: [PATCH] fix a pybullet.c issue on some compilers (don't allow for (int i=...) make the build_visual_studio_vr_pybullet_double.bat smart enough to find any Python installation in c:\python* --- build_visual_studio_vr_pybullet_double.bat | 17 +++++++++++++++-- examples/pybullet/pybullet.c | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/build_visual_studio_vr_pybullet_double.bat b/build_visual_studio_vr_pybullet_double.bat index 71d676172..6ca0652b9 100644 --- a/build_visual_studio_vr_pybullet_double.bat +++ b/build_visual_studio_vr_pybullet_double.bat @@ -1,8 +1,21 @@ - IF NOT EXIST bin mkdir bin IF NOT EXIST bin\openvr_api.dll copy examples\ThirdPartyLibs\openvr\bin\win32\openvr_api.dll bin +#optionally, hardcode the python path or +#SET myvar=c:\python-3.5.3 + +#find a python version (hopefully just 1) and use this +dir c:\python* /b /ad > tmp1234.txt + +set /p myvar1= < tmp1234.txt +set myvar=c:/%myvar1% +del tmp1234.txt + +#you can also override and hardcode the Python path like this (just remove the # hashmark in next line) +#SET myvar=c:\python-3.5.2 + cd build3 -premake4 --double --enable_openvr --enable_pybullet --python_include_dir="C:/Python-3.5.2/include" --python_lib_dir="C:/Python-3.5.2/libs" --targetdir="../bin" vs2010 +premake4 --double --enable_openvr --enable_pybullet --python_include_dir="%myvar%/include" --python_lib_dir="%myvar%/libs" --targetdir="../bin" vs2010 start vs2010 + diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index fb7eac035..1af256b47 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -1268,7 +1268,7 @@ static PyObject* pybullet_getVisualShapeData(PyObject* self, PyObject* args) b3SharedMemoryStatusHandle statusHandle; struct b3VisualShapeInformation visualShapeInfo; int statusType; - + int i; PyObject* pyResultList = 0; if (size == 1) @@ -1285,7 +1285,7 @@ static PyObject* pybullet_getVisualShapeData(PyObject* self, PyObject* args) { b3GetVisualShapeInformation(sm, &visualShapeInfo); pyResultList = PyTuple_New(visualShapeInfo.m_numVisualShapes); - for (int i = 0; i < visualShapeInfo.m_numVisualShapes; i++) + for (i = 0; i < visualShapeInfo.m_numVisualShapes; i++) { PyObject* visualShapeObList = PyTuple_New(7); PyObject* item;