mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
build: replace WIN32 => _WIN32
This commit is contained in:
+10
-10
@@ -55,7 +55,7 @@ static void* OutOfMemoryError(size_t size)
|
||||
|
||||
#if CV_USE_SYSTEM_MALLOC
|
||||
|
||||
#if defined WIN32 || defined _WIN32
|
||||
#if defined _WIN32
|
||||
void deleteThreadAllocData() {}
|
||||
#endif
|
||||
|
||||
@@ -93,7 +93,7 @@ void fastFree(void* ptr)
|
||||
|
||||
#define STAT(stmt)
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#if (_WIN32_WINNT >= 0x0602)
|
||||
#include <synchapi.h>
|
||||
#endif
|
||||
@@ -126,7 +126,7 @@ void SystemFree(void* ptr, size_t)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
#else //WIN32
|
||||
#else //_WIN32
|
||||
|
||||
#include <sys/mman.h>
|
||||
|
||||
@@ -155,7 +155,7 @@ void SystemFree(void* ptr, size_t size)
|
||||
{
|
||||
munmap(ptr, size);
|
||||
}
|
||||
#endif //WIN32
|
||||
#endif //_WIN32
|
||||
|
||||
struct AutoLock
|
||||
{
|
||||
@@ -399,7 +399,7 @@ struct ThreadData
|
||||
|
||||
Block* bins[MAX_BIN+1][3];
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#ifdef WINCE
|
||||
# define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
|
||||
#endif //WINCE
|
||||
@@ -418,7 +418,7 @@ struct ThreadData
|
||||
}
|
||||
return data;
|
||||
}
|
||||
#else //WIN32
|
||||
#else //_WIN32
|
||||
static void deleteData(void* data)
|
||||
{
|
||||
delete (ThreadData*)data;
|
||||
@@ -438,10 +438,10 @@ struct ThreadData
|
||||
}
|
||||
return data;
|
||||
}
|
||||
#endif //WIN32
|
||||
#endif //_WIN32
|
||||
};
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
DWORD ThreadData::tlsKey = TLS_OUT_OF_INDEXES;
|
||||
|
||||
void deleteThreadAllocData()
|
||||
@@ -450,9 +450,9 @@ void deleteThreadAllocData()
|
||||
delete (ThreadData*)TlsGetValue( ThreadData::tlsKey );
|
||||
}
|
||||
|
||||
#else //WIN32
|
||||
#else //_WIN32
|
||||
pthread_key_t ThreadData::tlsKey = 0;
|
||||
#endif //WIN32
|
||||
#endif //_WIN32
|
||||
|
||||
#if 0
|
||||
static void checkList(ThreadData* tls, int idx)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
# include <windows.h>
|
||||
const char dir_separators[] = "/\\";
|
||||
const char native_separator = '\\';
|
||||
@@ -139,7 +139,7 @@ const char native_separator = '/';
|
||||
|
||||
static bool isDir(const cv::String& path, DIR* dir)
|
||||
{
|
||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
DWORD attributes;
|
||||
BOOL status = TRUE;
|
||||
if (dir)
|
||||
|
||||
@@ -578,7 +578,7 @@ static void* initOpenCLAndLoad(const char* funcname)
|
||||
return funcname && handle ? dlsym(handle, funcname) : 0;
|
||||
}
|
||||
|
||||
#elif (defined WIN32 || defined _WIN32) && defined(HAVE_OPENCL)
|
||||
#elif defined _WIN32 && defined(HAVE_OPENCL)
|
||||
|
||||
#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
|
||||
#define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
|
||||
|
||||
@@ -1655,7 +1655,7 @@ Context& initializeContextFromGL()
|
||||
|
||||
cl_context_properties properties[] =
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
#if defined(_WIN32)
|
||||
CL_CONTEXT_PLATFORM, (cl_context_properties)platforms[i],
|
||||
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(),
|
||||
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(),
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
#include <opencv2/core/utils/trace.private.hpp>
|
||||
|
||||
#if defined WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
#include <windows.h>
|
||||
#undef small
|
||||
#undef min
|
||||
@@ -632,7 +632,7 @@ static inline int getNumberOfCPUsImpl()
|
||||
|
||||
int cv::getNumberOfCPUs(void)
|
||||
{
|
||||
#if defined WIN32 || defined _WIN32
|
||||
#if defined _WIN32
|
||||
SYSTEM_INFO sysinfo;
|
||||
#if (defined(_M_ARM) || defined(_M_X64) || defined(WINRT)) && _WIN32_WINNT >= 0x501
|
||||
GetNativeSystemInfo( &sysinfo );
|
||||
|
||||
@@ -148,7 +148,7 @@ BinaryFunc getCopyMaskFunc(size_t esz);
|
||||
/* maximal average node_count/hash_size ratio beyond which hash table is resized */
|
||||
#define CV_SPARSE_HASH_RATIO 3
|
||||
|
||||
#if defined WIN32 || defined _WIN32
|
||||
#if defined _WIN32
|
||||
void deleteThreadAllocData();
|
||||
#endif
|
||||
|
||||
@@ -288,7 +288,7 @@ struct CoreTLSData
|
||||
TLSData<CoreTLSData>& getCoreTlsData();
|
||||
|
||||
#if defined(BUILD_SHARED_LIBS)
|
||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
#define CL_RUNTIME_EXPORT __declspec(dllexport)
|
||||
#elif defined __GNUC__ && __GNUC__ >= 4
|
||||
#define CL_RUNTIME_EXPORT __attribute__ ((visibility ("default")))
|
||||
|
||||
@@ -48,14 +48,12 @@
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
#if defined WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
#include <windows.h>
|
||||
#undef small
|
||||
#undef min
|
||||
#undef max
|
||||
#undef abs
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP)
|
||||
|
||||
+12
-12
@@ -79,7 +79,7 @@ Mutex* __initialization_mutex_initializer = &getInitializationMutex();
|
||||
# include <cpu-features.h>
|
||||
#endif
|
||||
|
||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
|
||||
#define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
|
||||
#endif
|
||||
@@ -655,7 +655,7 @@ bool useOptimized(void)
|
||||
|
||||
int64 getTickCount(void)
|
||||
{
|
||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
LARGE_INTEGER counter;
|
||||
QueryPerformanceCounter( &counter );
|
||||
return (int64)counter.QuadPart;
|
||||
@@ -675,7 +675,7 @@ int64 getTickCount(void)
|
||||
|
||||
double getTickFrequency(void)
|
||||
{
|
||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
LARGE_INTEGER freq;
|
||||
QueryPerformanceFrequency(&freq);
|
||||
return (double)freq.QuadPart;
|
||||
@@ -737,7 +737,7 @@ int64 getCPUTickCount(void)
|
||||
|
||||
#endif
|
||||
|
||||
#elif defined _MSC_VER && defined WIN32 && defined _M_IX86
|
||||
#elif defined _MSC_VER && defined _WIN32 && defined _M_IX86
|
||||
|
||||
int64 getCPUTickCount(void)
|
||||
{
|
||||
@@ -799,7 +799,7 @@ String tempfile( const char* suffix )
|
||||
const char *temp_dir = getenv("OPENCV_TEMP_PATH");
|
||||
#endif
|
||||
|
||||
#if defined WIN32 || defined _WIN32
|
||||
#if defined _WIN32
|
||||
#ifdef WINRT
|
||||
RoInitialize(RO_INIT_MULTITHREADED);
|
||||
std::wstring temp_dir = GetTempPathWinRT();
|
||||
@@ -1124,7 +1124,7 @@ bool __termination = false;
|
||||
namespace cv
|
||||
{
|
||||
|
||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
||||
#if defined _WIN32 || defined WINCE
|
||||
|
||||
struct Mutex::Impl
|
||||
{
|
||||
@@ -1210,7 +1210,7 @@ bool Mutex::trylock() { return impl->trylock(); }
|
||||
|
||||
//////////////////////////////// thread-local storage ////////////////////////////////
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4505) // unreferenced local function has been removed
|
||||
#endif
|
||||
@@ -1229,16 +1229,16 @@ public:
|
||||
void SetData(void *pData);
|
||||
|
||||
private:
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#ifndef WINRT
|
||||
DWORD tlsKey;
|
||||
#endif
|
||||
#else // WIN32
|
||||
#else // _WIN32
|
||||
pthread_key_t tlsKey;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#ifdef WINRT
|
||||
static __declspec( thread ) void* tlsData = NULL; // using C++11 thread attribute for local thread data
|
||||
TlsAbstraction::TlsAbstraction() {}
|
||||
@@ -1270,7 +1270,7 @@ void TlsAbstraction::SetData(void *pData)
|
||||
CV_Assert(TlsSetValue(tlsKey, pData) == TRUE);
|
||||
}
|
||||
#endif
|
||||
#else // WIN32
|
||||
#else // _WIN32
|
||||
TlsAbstraction::TlsAbstraction()
|
||||
{
|
||||
CV_Assert(pthread_key_create(&tlsKey, NULL) == 0);
|
||||
@@ -1511,7 +1511,7 @@ TLSData<CoreTLSData>& getCoreTlsData()
|
||||
CV_SINGLETON_LAZY_INIT_REF(TLSData<CoreTLSData>, new TLSData<CoreTLSData>())
|
||||
}
|
||||
|
||||
#if defined CVAPI_EXPORTS && defined WIN32 && !defined WINCE
|
||||
#if defined CVAPI_EXPORTS && defined _WIN32 && !defined WINCE
|
||||
#ifdef WINRT
|
||||
#pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user