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 @@
#include "Types.h"
#ifdef _LINUX
#include "string.h"
#endif
template <class T>
class CArray
{
......@@ -133,7 +137,13 @@ public:
return FALSE;
m_aT[nIndex].~T();
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--;
return TRUE;
}
......@@ -150,7 +160,13 @@ public:
m_aT[nIndex + i].~T();
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));
#else
memmove((void*)(m_aT + nIndex), (void*)(m_aT + nIndex + nCount), (m_nSize - (nIndex + nCount)) * sizeof(T));
#endif
}
m_nSize--;
return TRUE;
}
......
......@@ -290,6 +290,7 @@ namespace NSFile
}
lOutputCount = (LONG)(pCodesCur - pData);
*pCodesCur++ = 0;
}
static void GetUtf8StringFromUnicode_2bytes(const wchar_t* pUnicodes, LONG lCount, BYTE*& pData, LONG& lOutputCount, bool bIsBOM = false)
......@@ -433,7 +434,7 @@ namespace NSFile
#else
BYTE* pUtf8 = NULL;
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");
delete [] pUtf8;
#endif
......@@ -455,7 +456,7 @@ namespace NSFile
#else
BYTE* pUtf8 = NULL;
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");
delete [] pUtf8;
#endif
......@@ -485,4 +486,4 @@ namespace NSFile
};
}
#endif //_BUILD_FILE_CROSSPLATFORM_H_
\ No newline at end of file
#endif //_BUILD_FILE_CROSSPLATFORM_H_
......@@ -9,14 +9,6 @@
#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
#define FALSE 0
#endif
......@@ -39,6 +31,12 @@ typedef int INT;
typedef unsigned int UINT, *PUINT;
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)))
typedef __int64 T_LONG64;
typedef unsigned __int64 T_ULONG64;
......@@ -52,6 +50,8 @@ typedef double T_ULONG64;
#endif //_MAC and int64
#endif
#endif
#ifndef VOID
typedef void VOID, *LPVOID;
#endif
......@@ -73,6 +73,14 @@ typedef long HRESULT;
#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)\
{\
if (pinterface!=NULL)\
......@@ -152,4 +160,4 @@ typedef long HRESULT;
}\
}
#endif //_BUILD_TYPES_CROSSPLATFORM_H_
\ No newline at end of file
#endif //_BUILD_TYPES_CROSSPLATFORM_H_
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