|
From: <th...@us...> - 2017-08-04 12:29:31
|
Revision: 771
http://sourceforge.net/p/py2exe/svn/771
Author: theller
Date: 2017-08-04 12:29:28 +0000 (Fri, 04 Aug 2017)
Log Message:
-----------
Use the ANSI version functions; now the source can be compiled even
when UNICODE is defined.
Modified Paths:
--------------
trunk/py2exe-3/source/MyLoadLibrary.c
trunk/py2exe-3/source/actctx.c
trunk/py2exe-3/source/run.c
trunk/py2exe-3/source/run_ctypes_dll.c
trunk/py2exe-3/source/run_w.c
trunk/py2exe-3/source/start.c
Modified: trunk/py2exe-3/source/MyLoadLibrary.c
===================================================================
--- trunk/py2exe-3/source/MyLoadLibrary.c 2017-08-01 13:59:44 UTC (rev 770)
+++ trunk/py2exe-3/source/MyLoadLibrary.c 2017-08-04 12:29:28 UTC (rev 771)
@@ -219,7 +219,7 @@
return lib->module;
}
}
- return LoadLibrary(name);
+ return LoadLibraryA(name);
}
BOOL MyFreeLibrary(HMODULE module)
Modified: trunk/py2exe-3/source/actctx.c
===================================================================
--- trunk/py2exe-3/source/actctx.c 2017-08-01 13:59:44 UTC (rev 770)
+++ trunk/py2exe-3/source/actctx.c 2017-08-04 12:29:28 UTC (rev 771)
@@ -26,7 +26,7 @@
ULONG_PTR ret = 0;
if (PyWin_DLLhActivationContext && pfnActivateActCtx)
if (!(*pfnActivateActCtx)(PyWin_DLLhActivationContext, &ret)) {
- OutputDebugString("py2exe failed to activate the activation context before loading a DLL\n");
+ OutputDebugStringA("py2exe failed to activate the activation context before loading a DLL\n");
ret = 0; // no promise the failing function didn't change it!
}
return ret;
@@ -36,5 +36,5 @@
{
if (cookie && pfnDeactivateActCtx)
if (!(*pfnDeactivateActCtx)(0, cookie))
- OutputDebugString("py2exe failed to de-activate the activation context\n");
+ OutputDebugStringA("py2exe failed to de-activate the activation context\n");
}
Modified: trunk/py2exe-3/source/run.c
===================================================================
--- trunk/py2exe-3/source/run.c 2017-08-01 13:59:44 UTC (rev 770)
+++ trunk/py2exe-3/source/run.c 2017-08-04 12:29:28 UTC (rev 771)
@@ -32,7 +32,7 @@
fprintf(stderr, msg);
if (error) {
LPVOID lpMsgBuf;
- FormatMessage(
+ FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
Modified: trunk/py2exe-3/source/run_ctypes_dll.c
===================================================================
--- trunk/py2exe-3/source/run_ctypes_dll.c 2017-08-01 13:59:44 UTC (rev 770)
+++ trunk/py2exe-3/source/run_ctypes_dll.c 2017-08-04 12:29:28 UTC (rev 771)
@@ -55,7 +55,7 @@
if (error) {
LPVOID lpMsgBuf;
- FormatMessage(
+ FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
@@ -69,9 +69,9 @@
LocalFree(lpMsgBuf);
} else
Buffer[0] = '\0';
- n = lstrlen(Buffer);
+ n = lstrlenA(Buffer);
_snprintf(Buffer+n, sizeof(Buffer)-n, msg);
- MessageBox(GetFocus(), Buffer, NULL, MB_OK | MB_ICONSTOP);
+ MessageBoxA(GetFocus(), Buffer, NULL, MB_OK | MB_ICONSTOP);
}
BOOL have_init = FALSE;
@@ -136,7 +136,7 @@
);
}
if (g_ctypes == NULL) {
- OutputDebugString("GetModuleHandle _ctypes.pyd failed");
+ OutputDebugStringA("GetModuleHandle _ctypes.pyd failed");
// give up in disgust
return -1;
}
@@ -213,7 +213,7 @@
// *****************************************************************
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
- OutputDebugString("DllMain");
+ OutputDebugStringA("DllMain");
if ( dwReason == DLL_PROCESS_ATTACH) {
gInstance = hInstance;
InitializeCriticalSection(&csInit);
@@ -221,7 +221,7 @@
if (pfnGetCurrentActCtx && pfnAddRefActCtx)
if ((*pfnGetCurrentActCtx)(&PyWin_DLLhActivationContext))
if (!(*pfnAddRefActCtx)(PyWin_DLLhActivationContext))
- OutputDebugString("Python failed to load the default activation context\n");
+ OutputDebugStringA("Python failed to load the default activation context\n");
}
else if ( dwReason == DLL_PROCESS_DETACH ) {
gInstance = 0;
@@ -277,7 +277,7 @@
wchar_t buf[300];
ULONG_PTR cookie = 0;
- OutputDebugString("DllRegisterServer");
+ OutputDebugStringA("DllRegisterServer");
/*
MessageBox(NULL,
"Debug\n",
@@ -288,10 +288,10 @@
check_init();
_My_DeactivateActCtx(cookie);
- OutputDebugString("check_init ok");
+ OutputDebugStringA("check_init ok");
state = PyGILState_Ensure();
- OutputDebugString("PyGILState_Ensure done");
+ OutputDebugStringA("PyGILState_Ensure done");
swprintf(buf,300,L"DllRegisterServer: libfilename=%s\n",&libfilename);
OutputDebugStringW(buf);
Modified: trunk/py2exe-3/source/run_w.c
===================================================================
--- trunk/py2exe-3/source/run_w.c 2017-08-01 13:59:44 UTC (rev 770)
+++ trunk/py2exe-3/source/run_w.c 2017-08-04 12:29:28 UTC (rev 771)
@@ -31,7 +31,7 @@
if (error) {
LPVOID lpMsgBuf;
- FormatMessage(
+ FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
@@ -45,9 +45,9 @@
LocalFree(lpMsgBuf);
} else
Buffer[0] = '\0';
- n = lstrlen(Buffer);
+ n = lstrlenA(Buffer);
_snprintf(Buffer+n, sizeof(Buffer)-n, msg);
- MessageBox(GetFocus(), Buffer, NULL, MB_OK | MB_ICONSTOP);
+ MessageBoxA(GetFocus(), Buffer, NULL, MB_OK | MB_ICONSTOP);
}
extern int init(char *);
Modified: trunk/py2exe-3/source/start.c
===================================================================
--- trunk/py2exe-3/source/start.c 2017-08-01 13:59:44 UTC (rev 770)
+++ trunk/py2exe-3/source/start.c 2017-08-04 12:29:28 UTC (rev 771)
@@ -115,7 +115,7 @@
*/
BOOL locate_script(HMODULE hmod)
{
- HRSRC hrsrc = FindResource(hmod, MAKEINTRESOURCE(1), "PYTHONSCRIPT");
+ HRSRC hrsrc = FindResourceA(hmod, MAKEINTRESOURCEA(1), "PYTHONSCRIPT");
HGLOBAL hgbl;
// load the script resource
@@ -281,7 +281,7 @@
HMODULE hmod = LoadLibraryExW(libfilename, NULL, LOAD_LIBRARY_AS_DATAFILE);
// Try to locate pythonxy.dll as resource in the exe
- hrsrc = FindResource(hmod, MAKEINTRESOURCE(1), PYTHONDLL);
+ hrsrc = FindResourceA(hmod, MAKEINTRESOURCEA(1), PYTHONDLL);
if (hrsrc) {
HGLOBAL hgbl;
DWORD size;
@@ -296,7 +296,7 @@
LOAD_WITH_ALTERED_SEARCH_PATH so that really our own one is
used.
*/
- hmod_pydll = LoadLibrary(PYTHONDLL);
+ hmod_pydll = LoadLibraryA(PYTHONDLL);
FreeLibrary(hmod);
return hmod_pydll;
}
@@ -384,7 +384,7 @@
if (!PyArg_ParseTuple(args, "is|zi", &hwnd, &message, &title, &flags))
return NULL;
- return PyLong_FromLong(MessageBox(hwnd, message, title, flags));
+ return PyLong_FromLong(MessageBoxA(hwnd, message, title, flags));
}
static PyObject *Py_SHGetSpecialFolderPath(PyObject *self, PyObject *args)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|