Commit 71c0d0d8 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55192 954022d7-b5bf-4e40-9824-e11837661b57
parent c4c971cf
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
#include "Types.h" #include "Types.h"
#ifdef _LINUX
#include "string.h"
#endif
template <class T> template <class T>
class CArray class CArray
{ {
...@@ -133,7 +137,13 @@ public: ...@@ -133,7 +137,13 @@ public:
return FALSE; return FALSE;
m_aT[nIndex].~T(); m_aT[nIndex].~T();
if (nIndex != (m_nSize - 1)) if (nIndex != (m_nSize - 1))
memmove_s((void*)(m_aT + nIndex), (m_nSize - nIndex) * sizeof(T), (void*)(m_aT + nIndex + 1), (m_nSize - (nIndex + 1)) * sizeof(T)); {
#ifdef WIN32
memmove_s((void*)(m_aT + nIndex), (m_nSize - nIndex) * sizeof(T), (void*)(m_aT + nIndex + 1), (m_nSize - (nIndex + 1)) * sizeof(T));
#else
memmove((void*)(m_aT + nIndex), (void*)(m_aT + nIndex + 1), (m_nSize - (nIndex + 1)) * sizeof(T));
#endif
}
m_nSize--; m_nSize--;
return TRUE; return TRUE;
} }
...@@ -150,7 +160,13 @@ public: ...@@ -150,7 +160,13 @@ public:
m_aT[nIndex + i].~T(); m_aT[nIndex + i].~T();
if ((nIndex + nCount) != m_nSize) if ((nIndex + nCount) != m_nSize)
{
#ifdef WIN32
memmove_s((void*)(m_aT + nIndex), (m_nSize - nIndex - nCount + 1) * sizeof(T), (void*)(m_aT + nIndex + nCount), (m_nSize - (nIndex + nCount)) * sizeof(T)); memmove_s((void*)(m_aT + nIndex), (m_nSize - nIndex - nCount + 1) * sizeof(T), (void*)(m_aT + nIndex + nCount), (m_nSize - (nIndex + nCount)) * sizeof(T));
#else
memmove((void*)(m_aT + nIndex), (void*)(m_aT + nIndex + nCount), (m_nSize - (nIndex + nCount)) * sizeof(T));
#endif
}
m_nSize--; m_nSize--;
return TRUE; return TRUE;
} }
......
...@@ -290,6 +290,7 @@ namespace NSFile ...@@ -290,6 +290,7 @@ namespace NSFile
} }
lOutputCount = (LONG)(pCodesCur - pData); lOutputCount = (LONG)(pCodesCur - pData);
*pCodesCur++ = 0;
} }
static void GetUtf8StringFromUnicode_2bytes(const wchar_t* pUnicodes, LONG lCount, BYTE*& pData, LONG& lOutputCount, bool bIsBOM = false) static void GetUtf8StringFromUnicode_2bytes(const wchar_t* pUnicodes, LONG lCount, BYTE*& pData, LONG& lOutputCount, bool bIsBOM = false)
...@@ -433,7 +434,7 @@ namespace NSFile ...@@ -433,7 +434,7 @@ namespace NSFile
#else #else
BYTE* pUtf8 = NULL; BYTE* pUtf8 = NULL;
LONG lLen = 0; LONG lLen = 0;
CUtf8Converter::GetUtf8StringFromUnicode(sFileName, sFileName.length(), pUtf8, lLen, true); CUtf8Converter::GetUtf8StringFromUnicode(sFileName.c_str(), sFileName.length(), pUtf8, lLen, false);
m_pFile = fopen((char*)pUtf8, "rb"); m_pFile = fopen((char*)pUtf8, "rb");
delete [] pUtf8; delete [] pUtf8;
#endif #endif
...@@ -455,7 +456,7 @@ namespace NSFile ...@@ -455,7 +456,7 @@ namespace NSFile
#else #else
BYTE* pUtf8 = NULL; BYTE* pUtf8 = NULL;
LONG lLen = 0; LONG lLen = 0;
CUtf8Converter::GetUtf8StringFromUnicode(sFileName, sFileName.length(), pUtf8, lLen, true); CUtf8Converter::GetUtf8StringFromUnicode(sFileName.c_str(), sFileName.length(), pUtf8, lLen, false);
m_pFile = fopen((char*)pUtf8, "wb"); m_pFile = fopen((char*)pUtf8, "wb");
delete [] pUtf8; delete [] pUtf8;
#endif #endif
...@@ -485,4 +486,4 @@ namespace NSFile ...@@ -485,4 +486,4 @@ namespace NSFile
}; };
} }
#endif //_BUILD_FILE_CROSSPLATFORM_H_ #endif //_BUILD_FILE_CROSSPLATFORM_H_
\ No newline at end of file
...@@ -9,14 +9,6 @@ ...@@ -9,14 +9,6 @@
#endif #endif
#endif #endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif
...@@ -39,6 +31,12 @@ typedef int INT; ...@@ -39,6 +31,12 @@ typedef int INT;
typedef unsigned int UINT, *PUINT; typedef unsigned int UINT, *PUINT;
typedef wchar_t WCHAR; typedef wchar_t WCHAR;
#ifdef _LINUX_QT
#include <inttypes.h>
typedef int64_t T_LONG64;
typedef uint64_t T_ULONG64;
#else
#if (!defined (_MAC) && (!defined(MIDL_PASS) || defined(__midl)) && (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64))) #if (!defined (_MAC) && (!defined(MIDL_PASS) || defined(__midl)) && (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64)))
typedef __int64 T_LONG64; typedef __int64 T_LONG64;
typedef unsigned __int64 T_ULONG64; typedef unsigned __int64 T_ULONG64;
...@@ -52,6 +50,8 @@ typedef double T_ULONG64; ...@@ -52,6 +50,8 @@ typedef double T_ULONG64;
#endif //_MAC and int64 #endif //_MAC and int64
#endif #endif
#endif
#ifndef VOID #ifndef VOID
typedef void VOID, *LPVOID; typedef void VOID, *LPVOID;
#endif #endif
...@@ -73,6 +73,14 @@ typedef long HRESULT; ...@@ -73,6 +73,14 @@ typedef long HRESULT;
#endif #endif
#endif #endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#define ADDREFINTERFACE(pinterface)\ #define ADDREFINTERFACE(pinterface)\
{\ {\
if (pinterface!=NULL)\ if (pinterface!=NULL)\
...@@ -152,4 +160,4 @@ typedef long HRESULT; ...@@ -152,4 +160,4 @@ typedef long HRESULT;
}\ }\
} }
#endif //_BUILD_TYPES_CROSSPLATFORM_H_ #endif //_BUILD_TYPES_CROSSPLATFORM_H_
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment