Skip to content

Commit 98c9e67

Browse files
committed
Fixed mistaken "C" linkage
[SVN r12268]
1 parent aeef66c commit 98c9e67

1 file changed

Lines changed: 31 additions & 36 deletions

File tree

test/m2.cpp

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,43 @@
1414
using boost::python::wrap;
1515
using boost::python::unwrap;
1616

17-
extern "C"
17+
// Get a simple (by value) from the argument, and return the
18+
// string it holds.
19+
PyObject* unwrap_simple(simple x)
1820
{
19-
// Get a simple (by value) from the argument, and return the
20-
// string it holds.
21-
PyObject* unwrap_simple(simple x)
22-
{
23-
return PyString_FromString(x.s);
24-
}
25-
26-
// Likewise, but demands that its possible to get a non-const
27-
// reference to the simple.
28-
PyObject* unwrap_simple_ref(simple& x)
29-
{
30-
return PyString_FromString(x.s);
31-
}
21+
return PyString_FromString(x.s);
22+
}
3223

33-
// Likewise, with a const reference to the simple object.
34-
PyObject* unwrap_simple_const_ref(simple const& x)
35-
{
36-
return PyString_FromString(x.s);
37-
}
24+
// Likewise, but demands that its possible to get a non-const
25+
// reference to the simple.
26+
PyObject* unwrap_simple_ref(simple& x)
27+
{
28+
return PyString_FromString(x.s);
29+
}
3830

39-
// Get an int (by value) from the argument, and convert it to a
40-
// Python Int.
41-
PyObject* unwrap_int(int x)
42-
{
43-
return PyInt_FromLong(x);
44-
}
31+
// Likewise, with a const reference to the simple object.
32+
PyObject* unwrap_simple_const_ref(simple const& x)
33+
{
34+
return PyString_FromString(x.s);
35+
}
4536

46-
// Get a non-const reference to an int from the argument
47-
PyObject* unwrap_int_ref(int& x)
48-
{
49-
return PyInt_FromLong(x);
50-
}
37+
// Get an int (by value) from the argument, and convert it to a
38+
// Python Int.
39+
PyObject* unwrap_int(int x)
40+
{
41+
return PyInt_FromLong(x);
42+
}
5143

52-
// Get a const reference to an int from the argument.
53-
PyObject* unwrap_int_const_ref(int const& x)
54-
{
55-
return PyInt_FromLong(x);
56-
}
44+
// Get a non-const reference to an int from the argument
45+
PyObject* unwrap_int_ref(int& x)
46+
{
47+
return PyInt_FromLong(x);
48+
}
5749

58-
// -------------------
50+
// Get a const reference to an int from the argument.
51+
PyObject* unwrap_int_const_ref(int const& x)
52+
{
53+
return PyInt_FromLong(x);
5954
}
6055

6156
// MSVC6 bug workaround

0 commit comments

Comments
 (0)