Parcourir la source

Z991239-6390 #comment 字符编码转换梳理

80374374 il y a 2 mois
Parent
commit
608c6f6d17

+ 32 - 0
Framework/Common/PlatformDef.h

@@ -30,4 +30,36 @@
 
 #endif
 
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
+	#define RVC_DEPRECATED(obj) [[deprecated]] obj
+	#define RVC_DEPRECATED_VAR(text, obj) [[deprecated(text)]] obj
+	#define RVC_NORETURN(obj) [[noreturn]] obj
+#elif defined(WIN32) && !defined(__CYGWIN__)
+	#define RVC_DEPRECATED(obj) __declspec(deprecated) obj
+	#define RVC_DEPRECATED_VAR(text, obj) __declspec(deprecated(text)) obj
+	#define RVC_NORETURN(obj) __declspec(noreturn) obj
+#elif defined(__GNUC__)
+#define RVC_DEPRECATED(obj) obj __attribute__((deprecated))
+#define RVC_DEPRECATED_VAR(text, obj) obj __attribute__((deprecated(text)))
+#define RVC_NORETURN(obj) __attribute__((__noreturn__)) obj
+#else
+	#define RVC_DEPRECATED(obj) obj
+	#define RVC_DEPRECATED_VAR(text, obj) obj
+	#define RVC_NORETURN(obj) obj
+#endif
+
+#if defined(__cplusplus) && (__cplusplus >= 201703L)
+	#define RVC_ATTR_UNUSED [[maybe_unused]]
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
+	#define RVC_ATTR_UNUSED [[maybe_unused]]
+#elif defined(__GNUC__) || defined(__clang__)
+	#define RVC_ATTR_UNUSED __attribute__((unused))
+#else
+	#define RVC_ATTR_UNUSED /** @since version 3.12.0 */
+#endif
+
+#define RVC_UNUSED(x) (void)(x)
+
+
+
 #endif //_RVC_PLATFORM_DEFINIED_H__

+ 0 - 7
Framework/libtoolkit/winfit.h

@@ -5,13 +5,6 @@
 extern "C" {
 #endif
 
-	static uint64_t get_tick_count() 
-	{
-		
-		/** nano sec to sec*/
-		return toolkit_hrtime() / 1000000;
-
-	}
 
 #ifdef __cplusplus
 } // extern "C" {

+ 4 - 5
Framework/spbase/spShareMemoryBase.cpp

@@ -499,14 +499,13 @@ void CMyLogFile::PrintCurTime()
 	TCHAR dateString[256];
 	SYSTEMTIME cur;
 	GetLocalTime(&cur);
-#if defined(_MSC_VER)
     sprintf(dateString, "[%4d-%.2d-%.2d,%.2d:%.2d:%.2d][%u][%u]  ", cur.wYear, cur.wMonth,
-            cur.wDay, cur.wHour, cur.wMinute, cur.wSecond, GetCurrentProcessId(), GetCurrentThreadId());
+            cur.wDay, cur.wHour, cur.wMinute, cur.wSecond, GetCurrentProcessId(), 
+#if defined(_MSC_VER)
+		GetCurrentThreadId());
 #else
-    sprintf(dateString, "[%4d-%.2d-%.2d,%.2d:%.2d:%.2d][%u][%u]  ", cur.wYear, cur.wMonth,
-            cur.wDay, cur.wHour, cur.wMinute, cur.wSecond, GetCurrentProcessId(), GetCurrentThreadIdFromSys());
+	 GetCurrentThreadIdFromSys());
 #endif //_MSC_VER
-
 	Output(dateString);
 }
 

+ 6 - 2
Framework/sphost/SpHostLog.cpp

@@ -178,8 +178,12 @@ void CMyLogFile::PrintCurTime()
 	SYSTEMTIME cur;
 	GetLocalTime(&cur);
 	sprintf(dateString, "[%4d%.2d%.2d %.2d:%.2d:%.2d.%03d][%u][%u] - ", cur.wYear, cur.wMonth,
-		cur.wDay, cur.wHour, cur.wMinute, cur.wSecond, cur.wMilliseconds, GetCurrentProcessId(), GetCurrentThreadId());
-
+		cur.wDay, cur.wHour, cur.wMinute, cur.wSecond, cur.wMilliseconds, GetCurrentProcessId(),
+#if defined(_MSC_VER)
+	GetCurrentThreadId());
+#else
+	GetCurrentThreadIdFromSys());
+#endif //_MSC_VER
 	Output(dateString);
 }
 

+ 13 - 0
Module/include/CommEntityUtil.hpp

@@ -528,6 +528,19 @@ static void ConvertGBK2Utf8(std::string& str)
 	str = dst;
 	if (dst) free(dst);
 }
+
+#else
+
+static void ConvertUtf82GBK(std::string& str)
+{
+	std::string notrans(str);
+}
+
+static void ConvertGBK2Utf8(std::string& str)
+{
+	std::string notrans(str);
+}
+
 #endif //_MSC_VER
 
 } //namespace Util

+ 1 - 0
Module/mod_chromium/baseEx.cpp

@@ -54,6 +54,7 @@ const std::wstring specialStr = L"乗俓僜刓匼哱圽塡奬媆峔嶾廫慭怽
 #if (defined _WIN32 || defined _WIN64)
 #include <ShellAPI.h>
 
+//TODO: CrossPlaform  [Gifur@2025728]
 std::string UtfToGbk(const char* utf8)
 {
 	std::string val(utf8);