1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

build: replace WIN32 => _WIN32

This commit is contained in:
Alexander Alekhin
2017-07-25 13:23:44 +03:00
parent 0194d5a2d5
commit 602f047fe8
59 changed files with 136 additions and 141 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
#include <map>
#include <iostream>
#ifdef HAVE_OPENGL
#ifdef WIN32
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN 1
#define NOMINMAX 1
#include <windows.h>
+1 -4
View File
@@ -1,13 +1,10 @@
#include <iostream>
#ifdef WIN32
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN 1
#define NOMINMAX 1
#include <windows.h>
#endif
#if defined(_WIN64)
#include <windows.h>
#endif
#if defined(__APPLE__)
#include <OpenGL/gl.h>
+2 -2
View File
@@ -1,7 +1,7 @@
// This sample demonstrates working on one piece of data using two GPUs.
// It splits input into two parts and processes them separately on different GPUs.
#ifdef WIN32
#ifdef _WIN32
#define NOMINMAX
#include <windows.h>
#else
@@ -25,7 +25,7 @@ using namespace cv::cuda;
// Thread
// OS-specific wrappers for multi-threading
#ifdef WIN32
#ifdef _WIN32
class Thread
{
struct UserData
+1 -1
View File
@@ -2,7 +2,7 @@
#include "opencv2/opencv_modules.hpp"
#if defined(HAVE_OPENCV_CUDACODEC) && defined(WIN32)
#if defined(HAVE_OPENCV_CUDACODEC) && defined(_WIN32)
#include <vector>
#include <numeric>
+9 -9
View File
@@ -5,7 +5,7 @@
// and call cv::Blur function. The result is mapped back to OpenGL texture
// and rendered through OpenGL API.
*/
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#elif defined(__linux__)
@@ -27,7 +27,7 @@
#include "winapp.hpp"
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
# pragma comment(lib, "opengl32.lib")
# pragma comment(lib, "glu32.lib")
#endif
@@ -74,7 +74,7 @@ public:
WinApp::cleanup();
}
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
@@ -169,7 +169,7 @@ public:
int init()
{
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
m_hDC = GetDC(m_hWnd);
if (setup_pixel_format() != 0)
@@ -219,7 +219,7 @@ public:
void print_info(MODE mode, float time, cv::String& oclDevName)
{
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
HDC hDC = m_hDC;
HFONT hFont = (HFONT)::GetStockObject(SYSTEM_FONT);
@@ -323,7 +323,7 @@ public:
glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, 1.0f, 0.1f);
glEnd();
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
SwapBuffers(m_hDC);
#elif defined(__linux__)
glXSwapBuffers(m_display, m_window);
@@ -394,7 +394,7 @@ protected:
m_timer.stop();
}
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
int setup_pixel_format()
{
PIXELFORMATDESCRIPTOR pfd;
@@ -459,7 +459,7 @@ private:
bool m_demo_processing;
MODE m_mode;
cv::String m_modeStr[2];
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
HDC m_hDC;
HGLRC m_hRC;
#elif defined(__linux__)
@@ -524,7 +524,7 @@ int main(int argc, char** argv)
int width = (int)cap.get(CAP_PROP_FRAME_WIDTH);
int height = (int)cap.get(CAP_PROP_FRAME_HEIGHT);
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
string wndname = "WGL Window";
#elif defined(__linux__)
string wndname = "GLX Window";
+11 -11
View File
@@ -1,4 +1,4 @@
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#elif defined(__linux__)
@@ -10,13 +10,13 @@
#include <string>
#include <GL/gl.h>
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
# include <GL/glu.h>
#elif defined(__linux__)
# include <GL/glx.h>
#endif
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
# define WINCLASS "WinAppWnd"
#endif
@@ -78,21 +78,21 @@ public:
m_width = width;
m_height = height;
m_window_name = window_name;
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
m_hInstance = ::GetModuleHandle(NULL);
#endif
}
virtual ~WinApp()
{
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
::UnregisterClass(WINCLASS, m_hInstance);
#endif
}
int create()
{
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
@@ -166,7 +166,7 @@ public:
virtual void cleanup()
{
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
::DestroyWindow(m_hWnd);
#elif defined(__linux__)
XDestroyWindow(m_display, m_window);
@@ -174,13 +174,13 @@ public:
#endif
}
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) = 0;
#endif
int run()
{
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
MSG msg;
::ZeroMemory(&msg, sizeof(msg));
@@ -217,7 +217,7 @@ public:
protected:
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
static LRESULT CALLBACK StaticWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
WinApp* pWnd;
@@ -252,7 +252,7 @@ protected:
virtual void idle() = 0;
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN32)
HINSTANCE m_hInstance;
HWND m_hWnd;
#elif defined(__linux__)