Commit a560bcb8 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Don't include wine/debug.h when compiling on Windows.

GetCPInfoExA() is missing on some Windows platforms, load it dynamically.
parent dbf5b2a3
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "mlang.h" #include "mlang.h"
#include "wine/test.h" #include "wine/test.h"
#include "wine/debug.h"
#ifndef CP_UNICODE #ifndef CP_UNICODE
#define CP_UNICODE 1200 #define CP_UNICODE 1200
...@@ -37,8 +36,14 @@ ...@@ -37,8 +36,14 @@
/*#define DUMP_CP_INFO*/ /*#define DUMP_CP_INFO*/
/*#define DUMP_SCRIPT_INFO*/ /*#define DUMP_SCRIPT_INFO*/
#ifdef DUMP_CP_INFO
#include "wine/debug.h"
#endif
#define TRACE_2 OutputDebugStringA #define TRACE_2 OutputDebugStringA
static BOOL (WINAPI *pGetCPInfoExA)(UINT,DWORD,LPCPINFOEXA);
static void test_multibyte_to_unicode_translations(IMultiLanguage2 *iML2) static void test_multibyte_to_unicode_translations(IMultiLanguage2 *iML2)
{ {
/* these APIs are broken regarding constness of the input buffer */ /* these APIs are broken regarding constness of the input buffer */
...@@ -336,14 +341,17 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags) ...@@ -336,14 +341,17 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags)
else else
trace("TranslateCharsetInfo failed for cp %u\n", cpinfo[i].uiFamilyCodePage); trace("TranslateCharsetInfo failed for cp %u\n", cpinfo[i].uiFamilyCodePage);
if (GetCPInfoExA(cpinfo[i].uiCodePage, 0, &cpinfoex)) if (pGetCPInfoExA)
trace("CodePage %u name: %s\n", cpinfo[i].uiCodePage, cpinfoex.CodePageName); {
else if (pGetCPInfoExA(cpinfo[i].uiCodePage, 0, &cpinfoex))
trace("GetCPInfoExA failed for cp %u\n", cpinfo[i].uiCodePage); trace("CodePage %u name: %s\n", cpinfo[i].uiCodePage, cpinfoex.CodePageName);
if (GetCPInfoExA(cpinfo[i].uiFamilyCodePage, 0, &cpinfoex)) else
trace("CodePage %u name: %s\n", cpinfo[i].uiFamilyCodePage, cpinfoex.CodePageName); trace("GetCPInfoExA failed for cp %u\n", cpinfo[i].uiCodePage);
else if (pGetCPInfoExA(cpinfo[i].uiFamilyCodePage, 0, &cpinfoex))
trace("GetCPInfoExA failed for cp %u\n", cpinfo[i].uiFamilyCodePage); trace("CodePage %u name: %s\n", cpinfo[i].uiFamilyCodePage, cpinfoex.CodePageName);
else
trace("GetCPInfoExA failed for cp %u\n", cpinfo[i].uiFamilyCodePage);
}
/* Win95 does not support UTF-7 */ /* Win95 does not support UTF-7 */
if (cpinfo[i].uiCodePage == CP_UTF7) continue; if (cpinfo[i].uiCodePage == CP_UTF7) continue;
...@@ -525,9 +533,12 @@ static void test_EnumScripts(IMultiLanguage2 *iML2, DWORD flags) ...@@ -525,9 +533,12 @@ static void test_EnumScripts(IMultiLanguage2 *iML2, DWORD flags)
START_TEST(mlang) START_TEST(mlang)
{ {
HINSTANCE lib;
IMultiLanguage2 *iML2 = NULL; IMultiLanguage2 *iML2 = NULL;
HRESULT ret; HRESULT ret;
lib=LoadLibraryA("mlang");
pGetCPInfoExA=(void*)GetProcAddress(lib,"GetCPInfoExA");
CoInitialize(NULL); CoInitialize(NULL);
TRACE_2("Call CoCreateInstance\n"); TRACE_2("Call CoCreateInstance\n");
ret = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER, ret = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER,
......
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