From ad6e1314a5e253a98d4116326fa0e642c706aab6 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Wed, 10 Apr 2013 11:52:44 -0400 Subject: [PATCH] Fix forward declaration of PyStructType for C++iness. Fix #16. --- src/wrapper/_pvt_struct_v3.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wrapper/_pvt_struct_v3.cpp b/src/wrapper/_pvt_struct_v3.cpp index 61e1cf84..c911c54a 100644 --- a/src/wrapper/_pvt_struct_v3.cpp +++ b/src/wrapper/_pvt_struct_v3.cpp @@ -10,7 +10,9 @@ #include <ctype.h> #include "numpy_init.hpp" -// static PyTypeObject PyStructType; +namespace { +extern PyTypeObject PyStructType; +} /* The translation function for each format character is table driven */ typedef struct _formatdef { @@ -1413,7 +1415,7 @@ static PyGetSetDef s_getsetlist[] = { {NULL} /* sentinel */ }; -static +namespace { PyTypeObject PyStructType = { PyVarObject_HEAD_INIT(NULL, 0) "Struct", @@ -1455,6 +1457,7 @@ PyTypeObject PyStructType = { s_new, /* tp_new */ PyObject_Del, /* tp_free */ }; +} /* ---- Standalone functions ---- */ -- GitLab