Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change module.hpp to align with Noetic #342

Merged
merged 1 commit into from
Jul 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 10 additions & 31 deletions cv_bridge/src/module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,29 @@
// limitations under the License.
//

#ifndef MODULE_HPP_
#define MODULE_HPP_
#ifndef CV_BRIDGE_MODULE_HPP_
#define CV_BRIDGE_MODULE_HPP_

#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/ndarrayobject.h>
#include <iostream>
#include <boost/python.hpp>
#include <cv_bridge/cv_bridge.h>
#include <Python.h>

#include <boost/python.hpp>
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/ndarrayobject.h>

#include <opencv2/core/core.hpp>
#include <iostream>

namespace bp = boost::python;

int convert_to_CvMat2(const PyObject * o, cv::Mat & m);

PyObject * pyopencv_from(const cv::Mat & m);

#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wconversion-null"
# pragma clang diagnostic ignored "-Wreturn-type"
#elif __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion-null"
# pragma GCC diagnostic ignored "-Wreturn-type"
#endif

#if PYTHON3
static int do_numpy_import()
{
import_array();
}
#else
static void do_numpy_import()
static void * do_numpy_import()
{
import_array();
return nullptr;
}
#endif

#ifdef __clang__
# pragma clang diagnostic pop
#elif __GNUC__
# pragma GCC diagnostic pop
#endif

#endif // MODULE_HPP_
#endif // CV_BRIDGE_MODULE_HPP_