mirror of
https://github.com/opencv/opencv.git
synced 2025-06-30 00:34:37 +08:00
Disable -Wreturn-type-c-linkage under clang-cl
clang-cl defines both __clang__ and _MSC_VER, yet uses `#pragma GCC` to disable certain diagnostics. At the time `-Wreturn-type-c-linkage` was reported by clang-cl. This PR fixes this behavior by reordering defines.
This commit is contained in:
parent
3f2377017c
commit
d1b533d399
@ -48,16 +48,19 @@
|
|||||||
#include "opencv2/core/types_c.h"
|
#include "opencv2/core/types_c.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
# ifdef _MSC_VER
|
/* disable MSVC warning C4190 / clang-cl -Wreturn-type-c-linkage:
|
||||||
/* disable warning C4190: 'function' has C-linkage specified, but returns UDT 'typename'
|
'function' has C-linkage specified, but returns UDT 'typename'
|
||||||
which is incompatible with C
|
which is incompatible with C
|
||||||
|
|
||||||
It is OK to disable it because we only extend few plain structures with
|
It is OK to disable it because we only extend few plain structures with
|
||||||
C++ constructors for simpler interoperability with C++ API of the library
|
C++ constructors for simpler interoperability with C++ API of the library
|
||||||
*/
|
*/
|
||||||
# pragma warning(disable:4190)
|
# if defined(__clang__)
|
||||||
# elif defined __clang__ && __clang_major__ >= 3
|
// handle clang on Linux and clang-cl (i. e. clang on Windows) first
|
||||||
# pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
|
# pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
|
||||||
|
# elif defined(_MSC_VER)
|
||||||
|
// then handle MSVC
|
||||||
|
# pragma warning(disable:4190)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user