コード例 #1
0
ファイル: string.c プロジェクト: felfert/FreeRDP
WCHAR* _wcsdup(const WCHAR* strSource)
{
	WCHAR* strDestination;

	if (strSource == NULL)
		return NULL;

#if sun
	strDestination = wsdup(strSource);
#elif defined(__APPLE__) && defined(__MACH__)
	strDestination = malloc(wcslen(strSource));

	if (strDestination != NULL)
		wcscpy(strDestination, strSource);
#else
	strDestination = (WCHAR*) wcsdup((wchar_t*) strSource);
#endif

	if (strDestination == NULL)
		perror("wcsdup");

	return strDestination;
}
コード例 #2
0
ファイル: string.c プロジェクト: BenoitDevolutions/FreeRDP
WCHAR* _wcsdup(const WCHAR* strSource)
{
	WCHAR* strDestination;

	if (strSource == NULL)
		return NULL;

#if defined(sun) && sun
	strDestination = wsdup(strSource);
#elif defined(__APPLE__) && defined(__MACH__) || defined(ANDROID)
	strDestination = malloc(wcslen((wchar_t*)strSource));

	if (strDestination != NULL)
		wcscpy((wchar_t*)strDestination, (const wchar_t*)strSource);

#else
	strDestination = (WCHAR*) wcsdup((wchar_t*) strSource);
#endif

	if (strDestination == NULL)
		WLog_ERR(TAG,"wcsdup");

	return strDestination;
}
コード例 #3
0
ファイル: memory.c プロジェクト: Cyclic/FreeRDP
wchar_t* xwcsdup(const wchar_t* wstr)
{
	wchar_t* mem;

	if (wstr == NULL)
		return NULL;

#ifdef _WIN32
	mem = _wcsdup(wstr);
#elif sun
	mem = wsdup(wstr);
#elif (defined(__APPLE__) && defined(__MACH__)) || defined(ANDROID)
	mem = xmalloc(wcslen(wstr));
	if (mem != NULL)
		wcscpy(mem, wstr);
#else
	mem = wcsdup(wstr);
#endif

	if (mem == NULL)
		perror("wstrdup");

	return mem;
}