From 98c9e67625052c9c3ee3dea2c3a338da96230e70 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 10 Jan 2002 13:59:14 +0000 Subject: [PATCH] Fixed mistaken "C" linkage [SVN r12268] --- test/m2.cpp | 67 +++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/test/m2.cpp b/test/m2.cpp index 3c5267d0..7ea1f9ac 100644 --- a/test/m2.cpp +++ b/test/m2.cpp @@ -14,48 +14,43 @@ using boost::python::wrap; using boost::python::unwrap; -extern "C" +// Get a simple (by value) from the argument, and return the +// string it holds. +PyObject* unwrap_simple(simple x) { - // Get a simple (by value) from the argument, and return the - // string it holds. - PyObject* unwrap_simple(simple x) - { - return PyString_FromString(x.s); - } + return PyString_FromString(x.s); +} - // Likewise, but demands that its possible to get a non-const - // reference to the simple. - PyObject* unwrap_simple_ref(simple& x) - { - return PyString_FromString(x.s); - } +// Likewise, but demands that its possible to get a non-const +// reference to the simple. +PyObject* unwrap_simple_ref(simple& x) +{ + return PyString_FromString(x.s); +} - // Likewise, with a const reference to the simple object. - PyObject* unwrap_simple_const_ref(simple const& x) - { - return PyString_FromString(x.s); - } +// Likewise, with a const reference to the simple object. +PyObject* unwrap_simple_const_ref(simple const& x) +{ + return PyString_FromString(x.s); +} - // Get an int (by value) from the argument, and convert it to a - // Python Int. - PyObject* unwrap_int(int x) - { - return PyInt_FromLong(x); - } +// Get an int (by value) from the argument, and convert it to a +// Python Int. +PyObject* unwrap_int(int x) +{ + return PyInt_FromLong(x); +} - // Get a non-const reference to an int from the argument - PyObject* unwrap_int_ref(int& x) - { - return PyInt_FromLong(x); - } +// Get a non-const reference to an int from the argument +PyObject* unwrap_int_ref(int& x) +{ + return PyInt_FromLong(x); +} - // Get a const reference to an int from the argument. - PyObject* unwrap_int_const_ref(int const& x) - { - return PyInt_FromLong(x); - } - - // ------------------- +// Get a const reference to an int from the argument. +PyObject* unwrap_int_const_ref(int const& x) +{ + return PyInt_FromLong(x); } // MSVC6 bug workaround