From 0c0d7a2b9b517f91320bc6a04cb90d0642268ecb Mon Sep 17 00:00:00 2001 From: jiayulong Date: Wed, 13 May 2026 14:21:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BA=92=E9=BA=9F=E7=B3=BB=E7=BB=9F=E9=80=82?= =?UTF-8?q?=E9=85=8D=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=B8=BB?= =?UTF-8?q?=E8=A6=81=E9=92=88=E5=AF=B9WIN32=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrawBase/include/drawbase_global.h | 19 +++++++++++-------- DrawBase/src/DrawBase.pro | 2 +- Slfio/src/slf.cpp | 17 +++++++++++++++++ .../SysUtility/utils/include/Turtle_globle.h | 4 ++-- .../WFCrystal/SysUtility/utils/src/Utils.cpp | 3 ++- Workflow/WFCrystal/WFCrystal.pro | 3 +++ qtpropertybrowser/Gradient.cpp | 2 +- qtpropertybrowser/Gradient.h | 7 +++++-- 8 files changed, 42 insertions(+), 15 deletions(-) diff --git a/DrawBase/include/drawbase_global.h b/DrawBase/include/drawbase_global.h index 27369af..20aafd9 100644 --- a/DrawBase/include/drawbase_global.h +++ b/DrawBase/include/drawbase_global.h @@ -1,11 +1,14 @@ -#ifndef DRAWBASE_GLOBAL_H +#ifndef DRAWBASE_GLOBAL_H #define DRAWBASE_GLOBAL_H +#ifdef WIN32 + # ifdef DRAWBASE_LIB_EXPORT + # define DRAWBASE_EXPORT __declspec(dllexport) + # else + # define DRAWBASE_EXPORT __declspec(dllimport) + # endif +#else + #define DRAWBASE_EXPORT +#endif -# ifdef DRAWBASE_LIB_EXPORT -# define DRAWBASE_EXPORT __declspec(dllexport) -# else -# define DRAWBASE_EXPORT __declspec(dllimport) -# endif - -#endif \ No newline at end of file +#endif diff --git a/DrawBase/src/DrawBase.pro b/DrawBase/src/DrawBase.pro index c5a737c..72145ab 100644 --- a/DrawBase/src/DrawBase.pro +++ b/DrawBase/src/DrawBase.pro @@ -28,7 +28,7 @@ INCLUDEPATH += ../../common \ ../../Workflow/WFEngine/ObjectModel/ObjectModelBase/include\ ../../Workflow/WFWidget/include -# HEADERS += ../include/*.h +HEADERS += ../include/*.h SOURCES += *.cpp diff --git a/Slfio/src/slf.cpp b/Slfio/src/slf.cpp index baffd82..798fe69 100644 --- a/Slfio/src/slf.cpp +++ b/Slfio/src/slf.cpp @@ -43,6 +43,7 @@ CString MemName(CString wellname,CString Curve) wchar_t* AnsiToUnicode(const char* szStr) { +#ifdef WIN32 int nLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szStr, -1, NULL, 0 ); if (nLen == 0) { @@ -51,9 +52,14 @@ wchar_t* AnsiToUnicode(const char* szStr) wchar_t* pResult = new wchar_t[nLen]; MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szStr, -1, pResult, nLen ); return pResult; +#else + wchar_t* pResult = new wchar_t[1]; + return pResult; +#endif } int IsMappingMem(const char *MemName) { +#ifdef WIN32 QString slf1=MemName; slf1.replace("\\","/"); slf1.replace(".","_"); @@ -65,9 +71,13 @@ int IsMappingMem(const char *MemName) // (GetLastError() == ERROR_ALREADY_EXISTS); CloseHandle(hMapFile); return fInit; +#else + return 0; +#endif } bool MappingMem(HANDLE *hHandle,LPSTR *hMem,int len,const char* name) { +#ifdef WIN32 QString slf1=name; slf1.replace("\\","/"); slf1.replace(".","_"); @@ -97,12 +107,19 @@ bool MappingMem(HANDLE *hHandle,LPSTR *hMem,int len,const char* name) 0); // default: map entire file if (*hMem == NULL) return FALSE; return TRUE; +#else + return FALSE; +#endif } void CloseView(HANDLE hMapObject,LPVOID lpvMem) { +#ifdef WIN32 if(lpvMem)UnmapViewOfFile(lpvMem); if(hMapObject)CloseHandle(hMapObject); +#else + return; +#endif } time_t StringToTime(char * szTime) diff --git a/Workflow/WFCrystal/SysUtility/utils/include/Turtle_globle.h b/Workflow/WFCrystal/SysUtility/utils/include/Turtle_globle.h index 8897b7c..fbf88cf 100644 --- a/Workflow/WFCrystal/SysUtility/utils/include/Turtle_globle.h +++ b/Workflow/WFCrystal/SysUtility/utils/include/Turtle_globle.h @@ -1,4 +1,4 @@ -/** +/** * @file Turtle_globle.h * @brief * @@ -10,7 +10,7 @@ namespace pai{ namespace turtle { -#if defined(_WINDOWS) +#if defined(WIN32) #define PAI_CURRENT_FUNCTION __FUNCSIG__ #define __func__ __FUNCTION__ #define VARIABLE_IS_NOT_USED __attribute__ ((unused)) diff --git a/Workflow/WFCrystal/SysUtility/utils/src/Utils.cpp b/Workflow/WFCrystal/SysUtility/utils/src/Utils.cpp index fe189e8..6937882 100644 --- a/Workflow/WFCrystal/SysUtility/utils/src/Utils.cpp +++ b/Workflow/WFCrystal/SysUtility/utils/src/Utils.cpp @@ -1,4 +1,4 @@ -#ifdef LLToString +#ifdef LLToString #undef LLToString #endif #include @@ -30,6 +30,7 @@ using std::endl; #include #include #include +#include #endif using namespace pai::turtle; diff --git a/Workflow/WFCrystal/WFCrystal.pro b/Workflow/WFCrystal/WFCrystal.pro index 32edbb9..3cc872d 100644 --- a/Workflow/WFCrystal/WFCrystal.pro +++ b/Workflow/WFCrystal/WFCrystal.pro @@ -59,6 +59,9 @@ HEADERS += \ ./SysUtility/utils/include/PAIConst.h \ ./SysUtility/configuration/include/Configure.h +HEADERS += \ + ./SysUtility/utils/include/*.h + SOURCES += \ ./Crystal/src/GlobalUtility.cpp \ ./Crystal/src/IExtension.cpp \ diff --git a/qtpropertybrowser/Gradient.cpp b/qtpropertybrowser/Gradient.cpp index bb2e9ec..dc696e9 100644 --- a/qtpropertybrowser/Gradient.cpp +++ b/qtpropertybrowser/Gradient.cpp @@ -1,7 +1,7 @@ #include "Gradient.h" #include -#include "math.h" +#include //extern char *GetBinDir(char *str); BYTE GetRValue(COLORREF colour) diff --git a/qtpropertybrowser/Gradient.h b/qtpropertybrowser/Gradient.h index 20271e3..296ef22 100644 --- a/qtpropertybrowser/Gradient.h +++ b/qtpropertybrowser/Gradient.h @@ -24,8 +24,11 @@ typedef DWORD *LPCOLORREF; //#define GetRValue(rgb) (LOBYTE(rgb)) //#define GetGValue(rgb) (LOBYTE(((WORD)(rgb)) >> 8)) //#define GetBValue(rgb) (LOBYTE((rgb)>>16)) - -typedef COLORREF (__cdecl* InterpolateFn)(COLORREF first, COLORREF second, float position, float start, float end); +#ifdef WIN32 + typedef COLORREF (__cdecl* InterpolateFn)(COLORREF first, COLORREF second, float position, float start, float end); +#else + typedef COLORREF (* InterpolateFn)(COLORREF first, COLORREF second, float position, float start, float end); +#endif typedef struct CPeg { COLORREF colour; float position;