win: pybind11: workaround for strdup

This commit is contained in:
looooo
2018-02-14 17:16:48 +01:00
committed by wmayer
parent ae6512500b
commit 088b2687ea
3 changed files with 18 additions and 7 deletions

View File

@@ -21,6 +21,11 @@
***************************************************************************/
#ifdef _MSC_VER
#define strdup _strdup
#endif
#include "PreCompiled.h"
#include <Mod/Part/App/TopoShapeFacePy.h>
#include <Mod/Part/App/TopoShapeEdgePy.h>
@@ -50,6 +55,7 @@
#include <ShapeFix_Edge.hxx>
namespace py = pybind11;
const TopoDS_Face& getTopoDSFace(py::object* face)

View File

@@ -2,6 +2,11 @@
// Copyright 2017, Lorenz Lechner
// This program is released under the BSD license. See the file COPYING for details.
#ifdef _MSC_VER
#define strdup _strdup
#endif
#include "Area.h"
#include "Point.h"
#include "AreaDxf.h"
@@ -13,6 +18,8 @@
#include <vector>
namespace py = pybind11;

View File

@@ -29,13 +29,11 @@ class TemplateClassPyExport (template.ModelTemplate):
file = open(path + exportName + "Imp.cpp",'wb')
generateBase.generateTools.replace(self.TemplateImplement,locals(),file)
file.close()
file = open(path + exportName + ".cpp",'wb')
generateBase.generateTools.replace(self.TemplateModule,locals(),file)
file.close()
file = open(path + exportName + ".h",'wb')
generateBase.generateTools.replace(self.TemplateHeader,locals(),file)
#file.write( generateBase.generateTools.replace(self.Template,locals()))
file.close()
with open(path + exportName + ".cpp", 'wb') as file:
generateBase.generateTools.replace(self.TemplateModule,locals(),file)
with open(path + exportName + ".h", 'wb') as file:
generateBase.generateTools.replace(self.TemplateHeader,locals(),file)
#file.write( generateBase.generateTools.replace(self.Template,locals()))
TemplateHeader = """
// This file is generated by src/Tools/generateTemaplates/templateClassPyExport.py out of the XML file