Cleanup: Remove using-directive from freestyle headers
The header files in freestyle utilize the using-directive at the global file scope. This is a bad practice as it pollutes the global name space causing possible ambiguous reference compilation errors. In particular, the DNA files that are included by freestyle will cause those ambiguous reference errors when the developers adds a DNA member with a type name that also exist in the Freestyle name space, such as Curve and possibly others. This patch does the minimal work needed to resolve that by moving the using-directives from the headers into the corresponding translation units. Reviewed By: Brecht Differential Revision: https://developer.blender.org/D10351
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
using namespace Freestyle;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*----------------------FEdge methods ----------------------------*/
|
||||
|
||||
@@ -37,7 +37,7 @@ extern PyTypeObject FEdge_Type;
|
||||
/*---------------------------Python BPy_FEdge structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_Interface1D py_if1D;
|
||||
FEdge *fe;
|
||||
Freestyle::FEdge *fe;
|
||||
} BPy_FEdge;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
using namespace Freestyle;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*----------------------CurvePoint methods ----------------------------*/
|
||||
|
||||
@@ -37,7 +37,7 @@ extern PyTypeObject FrsCurve_Type;
|
||||
/*---------------------------Python BPy_FrsCurve structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_Interface1D py_if1D;
|
||||
Curve *c;
|
||||
Freestyle::Curve *c;
|
||||
} BPy_FrsCurve;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
using namespace Freestyle;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*----------------------Stroke methods ----------------------------*/
|
||||
|
||||
@@ -37,7 +37,7 @@ extern PyTypeObject Stroke_Type;
|
||||
/*---------------------------Python BPy_Stroke structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_Interface1D py_if1D;
|
||||
Stroke *s;
|
||||
Freestyle::Stroke *s;
|
||||
} BPy_Stroke;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
using namespace Freestyle;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*----------------------ViewEdge methods ----------------------------*/
|
||||
|
||||
@@ -37,7 +37,7 @@ extern PyTypeObject ViewEdge_Type;
|
||||
/*---------------------------Python BPy_ViewEdge structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_Interface1D py_if1D;
|
||||
ViewEdge *ve;
|
||||
Freestyle::ViewEdge *ve;
|
||||
} BPy_ViewEdge;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
using namespace Freestyle;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*----------------------Chain methods ----------------------------*/
|
||||
|
||||
@@ -37,7 +37,7 @@ extern PyTypeObject Chain_Type;
|
||||
/*---------------------------Python BPy_Chain structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_FrsCurve py_c;
|
||||
Chain *c;
|
||||
Freestyle::Chain *c;
|
||||
} BPy_Chain;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
using namespace Freestyle;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*----------------------FEdgeSharp methods ----------------------------*/
|
||||
|
||||
@@ -37,7 +37,7 @@ extern PyTypeObject FEdgeSharp_Type;
|
||||
/*---------------------------Python BPy_FEdgeSharp structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_FEdge py_fe;
|
||||
FEdgeSharp *fes;
|
||||
Freestyle::FEdgeSharp *fes;
|
||||
} BPy_FEdgeSharp;
|
||||
|
||||
/*---------------------------Python BPy_FEdgeSharp visible prototypes-----------*/
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
using namespace Freestyle;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*----------------------FEdgeSmooth methods ----------------------------*/
|
||||
|
||||
@@ -38,7 +38,7 @@ extern PyTypeObject FEdgeSmooth_Type;
|
||||
/*---------------------------Python BPy_FEdgeSmooth structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_FEdge py_fe;
|
||||
FEdgeSmooth *fes;
|
||||
Freestyle::FEdgeSmooth *fes;
|
||||
} BPy_FEdgeSmooth;
|
||||
|
||||
/*---------------------------Python BPy_FEdgeSmooth visible prototypes-----------*/
|
||||
|
||||
Reference in New Issue
Block a user