Rename common.hpp to ocvrs_common.hpp
MODIFY
binding-generator/src/generator.rs
binding-generator/src/generator.rs
@@ -78,7 +78,7 @@ struct OpenCVWalker<'tu, V: for<'gtu> GeneratorVisitor<'gtu>> {
impl<'tu, V: for<'gtu> GeneratorVisitor<'gtu>> EntityWalkerVisitor<'tu> for OpenCVWalker<'tu, V> {
fn wants_file(&mut self, path: &Path) -> bool {
- self.visitor.wants_file(path) || path.ends_with("common.hpp")
+ self.visitor.wants_file(path) || path.ends_with("ocvrs_common.hpp")
}
fn visit_entity(&mut self, entity: Entity<'tu>) -> bool {

MODIFY
binding-generator/src/writer/rust_native/mod.rs
binding-generator/src/writer/rust_native/mod.rs
@@ -243,7 +243,7 @@ impl Drop for RustNativeBindingWriter<'_> {
let includes = if self.src_cpp_dir.join(format!("{}.hpp", self.module)).exists() {
format!("#include \"{module}.hpp\"\n", module=self.module)
} else {
- format!("#include \"common.hpp\"\n#include <opencv2/{module}.hpp>", module=self.module)
+ format!("#include \"ocvrs_common.hpp\"\n#include <opencv2/{module}.hpp>", module=self.module)
};
File::create(&self.cpp_path).expect("Can't create cpp file")
.write_all(CPP.interpolate(&hashmap! {

MODIFY
src_cpp/aruco.hpp
src_cpp/aruco.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/aruco.hpp>
#include <opencv2/aruco/charuco.hpp>

MODIFY
src_cpp/bioinspired.hpp
src_cpp/bioinspired.hpp
#define HAVE_OPENCV_OCL // 3.2
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/bioinspired.hpp>

MODIFY
src_cpp/calib3d.hpp
src_cpp/calib3d.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/calib3d.hpp>
namespace cv {

MODIFY
src_cpp/ccalib.hpp
src_cpp/ccalib.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/ccalib.hpp>
#include <opencv2/ccalib/multicalib.hpp>

MODIFY
src_cpp/core.hpp
src_cpp/core.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/core/affine.hpp>
#include <opencv2/core/directx.hpp>
#include <opencv2/core/ocl.hpp>

MODIFY
src_cpp/dnn.hpp
src_cpp/dnn.hpp
#define CV_DNN_DONT_ADD_INLINE_NS
#endif
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/dnn.hpp>
#if CV_VERSION_MAJOR == 4
#include <opencv2/dnn/version.hpp>

MODIFY
src_cpp/face.hpp
src_cpp/face.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/face.hpp>
#include <opencv2/face/bif.hpp>

MODIFY
src_cpp/hdf.hpp
src_cpp/hdf.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/hdf.hpp>

MODIFY
src_cpp/imgproc.hpp
src_cpp/imgproc.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/imgproc.hpp>
namespace cv {

MODIFY
src_cpp/manual-features2d.cpp
src_cpp/manual-features2d.cpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/features2d.hpp>
template struct Result<void*>;

RENAME
src_cpp/common.hpp
src_cpp/ocvrs_common.hpp
+#ifndef __OCVRS_COMMON_HPP__
+#define __OCVRS_COMMON_HPP__
+
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) \
|| defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
#define OCVRS_TARGET_OS_WINDOWS
@@ -52,3 +55,4 @@ template<typename T> inline T Err(int code, const char* msg) {
return ret;
}
+#endif

MODIFY
src_cpp/ocvrs_resolve_types.hpp
src_cpp/ocvrs_resolve_types.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <vector>
/* Dummy namespace that contains types that will be used in the bindings generator to resolve clang::Type from

MODIFY
src_cpp/sfm.hpp
src_cpp/sfm.hpp
#define CERES_FOUND true
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/sfm.hpp>
#include <opencv2/sfm/robust.hpp>

MODIFY
src_cpp/videoio.hpp
src_cpp/videoio.hpp
-#include "common.hpp"
+#include "ocvrs_common.hpp"
#include <opencv2/videoio.hpp>
#if !(CV_VERSION_MAJOR == 3 && CV_VERSION_MINOR == 2)
#include <opencv2/videoio/registry.hpp>

Rename common.hpp to ocvrs_common.hpp