Fix MSVC build issues

This commit is contained in:
Andrey Kamaev
2013-03-30 00:47:22 +04:00
parent 2b1ef95415
commit 71e43852ce
10 changed files with 39 additions and 24 deletions

View File

@@ -47,6 +47,15 @@
#include "opencv2/core/types_c.h"
#ifdef __cplusplus
#ifdef _MSC_VER
/* disable warning C4190: 'function' has C-linkage specified, but returns UDT 'typename'
which is incompatible with C
It is OK to disable it because we only extend few plain structures with
C++ construrtors for simpler interoperability with C++ API of the library
*/
# pragma warning(disable:4190)
#endif
extern "C" {
#endif

View File

@@ -257,10 +257,10 @@ public:
/*!
Utility methods
*/
template<typename _Tp, int m> double determinant(const Matx<_Tp, m, m>& a);
template<typename _Tp, int m, int n> double trace(const Matx<_Tp, m, n>& a);
template<typename _Tp, int m, int n> double norm(const Matx<_Tp, m, n>& M);
template<typename _Tp, int m, int n> double norm(const Matx<_Tp, m, n>& M, int normType);
template<typename _Tp, int m> static double determinant(const Matx<_Tp, m, m>& a);
template<typename _Tp, int m, int n> static double trace(const Matx<_Tp, m, n>& a);
template<typename _Tp, int m, int n> static double norm(const Matx<_Tp, m, n>& M);
template<typename _Tp, int m, int n> static double norm(const Matx<_Tp, m, n>& M, int normType);
@@ -399,7 +399,7 @@ public:
/*!
Utility methods
*/
template<typename _Tp, int cn> Vec<_Tp, cn> normalize(const Vec<_Tp, cn>& v);
template<typename _Tp, int cn> static Vec<_Tp, cn> normalize(const Vec<_Tp, cn>& v);

View File

@@ -517,7 +517,7 @@ public:
typedef _Tp channel_type;
enum { generic_type = 0,
depth = DataType<channel_type>::value,
depth = DataType<channel_type>::depth,
channels = 4,
fmt = DataType<channel_type>::fmt + ((channels - 1) << 8),
type = CV_MAKETYPE(depth, channels)

View File

@@ -267,7 +267,7 @@ CV_INLINE double cvRandReal( CvRNG* rng )
#define IPL_BORDER_REFLECT 2
#define IPL_BORDER_WRAP 3
typedef struct _IplImage
typedef struct CV_EXPORTS _IplImage
{
int nSize; /* sizeof(IplImage) */
int ID; /* version (=0)*/
@@ -558,7 +558,7 @@ CV_INLINE int cvIplDepth( int type )
#define CV_MAX_DIM 32
#define CV_MAX_DIM_HEAP 1024
typedef struct CvMatND
typedef struct CV_EXPORTS CvMatND
{
int type;
int dims;
@@ -626,7 +626,7 @@ typedef struct CV_EXPORTS CvSparseMat
CvSparseMat;
#ifdef __cplusplus
CvSparseMat* cvCreateSparseMat(const cv::SparseMat& m);
CV_EXPORTS CvSparseMat* cvCreateSparseMat(const cv::SparseMat& m);
#endif
#define CV_IS_SPARSE_MAT_HDR(mat) \