mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
enum_print() removed; it was not reachable anyway since enum inherits
from Python's built-in int type. However, the appearance of FILE* raised questions about using extensions compiled with Visual C++ 8 with a Python compiled with Visual C++ 7.1. [SVN r32301]
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
#include <boost/python/extract.hpp>
|
||||
#include <boost/python/object_protocol.hpp>
|
||||
#include <structmember.h>
|
||||
#include <cstdio>
|
||||
|
||||
namespace boost { namespace python { namespace objects {
|
||||
|
||||
@@ -31,23 +30,6 @@ static PyMemberDef enum_members[] = {
|
||||
|
||||
extern "C"
|
||||
{
|
||||
static int
|
||||
enum_print(PyObject *v, BOOST_CSTD_::FILE *fp, int flags)
|
||||
{
|
||||
PyObject* s
|
||||
= (flags & Py_PRINT_RAW) ? v->ob_type->tp_str(v) : v->ob_type->tp_repr(v);
|
||||
if (s == 0)
|
||||
return -1;
|
||||
|
||||
char const* text = PyString_AsString(s);
|
||||
if (text == 0)
|
||||
return -1;
|
||||
|
||||
BOOST_CSTD_::fprintf(fp, text);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* flags -- not used but required by interface */
|
||||
static PyObject* enum_repr(PyObject* self_)
|
||||
{
|
||||
enum_object* self = downcast<enum_object>(self_);
|
||||
@@ -86,7 +68,7 @@ static PyTypeObject enum_type_object = {
|
||||
sizeof(enum_object), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
enum_print, /* tp_print */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_compare */
|
||||
|
||||
Reference in New Issue
Block a user