From 7a6d3e187d6b1d1daa0eecb7de6c66207d30571a Mon Sep 17 00:00:00 2001 From: vp153 Date: Mon, 5 Apr 2010 18:50:38 +0000 Subject: [PATCH] fixed build on MSVC 2003 git-svn-id: https://code.ros.org/svn/opencv/trunk@2993 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08 --- opencv/src/cxcore/cxsystem.cpp | 24 ++++++++++++++++++++++-- opencv/tests/cxts/cxts.cpp | 4 ++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/opencv/src/cxcore/cxsystem.cpp b/opencv/src/cxcore/cxsystem.cpp index f3123428..e250cc9d 100644 --- a/opencv/src/cxcore/cxsystem.cpp +++ b/opencv/src/cxcore/cxsystem.cpp @@ -44,8 +44,28 @@ #if defined WIN32 || defined WIN64 || defined _WIN64 || defined WINCE #include -#ifdef _MSC_VER -#include +#if defined _MSC_VER + #if _MSC_VER >= 1400 + #include + #elif defined _M_IX86 + static void __cpuid(int* cpuid_data, int) + { + __asm + { + push ebx + push edi + mov edi, cpuid_data + mov eax, 1 + cpuid + mov [edi], eax + mov [edi + 4], ebx + mov [edi + 8], ecx + mov [edi + 12], edx + pop edi + pop ebx + } + } + #endif #endif #else #include diff --git a/opencv/tests/cxts/cxts.cpp b/opencv/tests/cxts/cxts.cpp index b160ac7f..37c38cb4 100644 --- a/opencv/tests/cxts/cxts.cpp +++ b/opencv/tests/cxts/cxts.cpp @@ -1783,6 +1783,10 @@ void CvTS::print_summary_tailer( int streams ) } } +#if defined _MSC_VER && _MSC_VER < 1400 +#undef vsnprintf +#define vsnprintf _vsnprintf +#endif void CvTS::vprintf( int streams, const char* fmt, va_list l ) { -- 2.39.2