Commit 60e0b44c authored by Ghislain MARY's avatar Ghislain MARY

Fix OutputDebugString in unicode on Windows Phone.

parent 890e2306
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<ClCompile> <ClCompile>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;_DEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;_DEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild> <MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks> <BasicRuntimeChecks>Default</BasicRuntimeChecks>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;NDEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;NDEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<ClCompile> <ClCompile>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;_DEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;_DEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild> <MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks> <BasicRuntimeChecks>Default</BasicRuntimeChecks>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<ClCompile> <ClCompile>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;NDEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;NDEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
......
...@@ -50,7 +50,11 @@ BOOL WINAPI DllMain( ...@@ -50,7 +50,11 @@ BOOL WINAPI DllMain(
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
OutputDebugString("--> dll_entry.c - oRTP.dll - DLL_PROCESS_ATTACH()\n"); #ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - DLL_PROCESS_ATTACH()\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - DLL_PROCESS_ATTACH()\n");
#endif
wVersionRequested = MAKEWORD( 1, 0 ); wVersionRequested = MAKEWORD( 1, 0 );
...@@ -92,7 +96,11 @@ BOOL WINAPI DllMain( ...@@ -92,7 +96,11 @@ BOOL WINAPI DllMain(
if (fInit) if (fInit)
{ {
OutputDebugString("--> dll_entry.c - oRTP.dll - Initializing module\n"); #ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - Initializing module\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - Initializing module\n");
#endif
#ifdef WINAPI_FAMILY_PHONE_APP #ifdef WINAPI_FAMILY_PHONE_APP
lpSharedData->m_ullStartTime = GetTickCount64(); lpSharedData->m_ullStartTime = GetTickCount64();
...@@ -107,7 +115,11 @@ BOOL WINAPI DllMain( ...@@ -107,7 +115,11 @@ BOOL WINAPI DllMain(
} }
else else
{ {
OutputDebugString("--> dll_entry.c - oRTP.dll - Binding\n"); #ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - Binding\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - Binding\n");
#endif
lpSharedData->m_nReference++; lpSharedData->m_nReference++;
} }
break; break;
...@@ -135,13 +147,21 @@ BOOL WINAPI DllMain( ...@@ -135,13 +147,21 @@ BOOL WINAPI DllMain(
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
if (lpSharedData != NULL) if (lpSharedData != NULL)
{ {
OutputDebugString("--> dll_entry.c - oRTP.dll - Binding\n"); #ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - Binding\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - Binding\n");
#endif
lpSharedData->m_nReference--; lpSharedData->m_nReference--;
if (lpSharedData->m_nReference == 0) if (lpSharedData->m_nReference == 0)
{ {
OutputDebugString("--> dll_entry.c - oRTP.dll - Detaching\n"); #ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - Detaching\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - Detaching\n");
#endif
ortp_exit(); ortp_exit();
UnregisterLog(&dwoRTPLogLevel, "LOG_ORTP"); UnregisterLog(&dwoRTPLogLevel, "LOG_ORTP");
......
...@@ -152,8 +152,19 @@ static void __ortp_logv_out(OrtpLogLevel lev, const char *fmt, va_list args){ ...@@ -152,8 +152,19 @@ static void __ortp_logv_out(OrtpLogLevel lev, const char *fmt, va_list args){
} }
msg=ortp_strdup_vprintf(fmt,args); msg=ortp_strdup_vprintf(fmt,args);
#if defined(_MSC_VER) && !defined(_WIN32_WCE) #if defined(_MSC_VER) && !defined(_WIN32_WCE)
OutputDebugString(msg); #ifndef _UNICODE
OutputDebugString("\r\n"); OutputDebugStringA(msg);
OutputDebugStringA("\r\n");
#else
{
int len=strlen(msg);
wchar_t *tmp=(wchar_t*)ortp_malloc0((len+1)*sizeof(wchar_t));
mbstowcs(tmp,msg,len);
OutputDebugStringW(tmp);
OutputDebugStringW(L"\r\n");
ortp_free(tmp);
}
#endif
#endif #endif
fprintf(__log_file,"ortp-%s-%s" ENDLINE,lname,msg); fprintf(__log_file,"ortp-%s-%s" ENDLINE,lname,msg);
fflush(__log_file); fflush(__log_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