* lib/Makefile,in; Add directx to .PHONY target.
* lib/directx/dxerr.c: Remove dependence on mingw runtime. Don't include stdio.h or tchar.h. Replace _T() macro with TEXT() macro, throughout. Replace, _stprintf with wsprintf, throughout.
This commit is contained in:
parent
81f5200ba3
commit
7308c39e33
|
@ -1,3 +1,11 @@
|
||||||
|
2004-03-29 Danny Smith <dannysmith@users.sourceforge.net>
|
||||||
|
|
||||||
|
* lib/Makefile,in; Add directx to .PHONY target.
|
||||||
|
* lib/directx/dxerr.c: Remove dependence on mingw runtime.
|
||||||
|
Don't include stdio.h or tchar.h.
|
||||||
|
Replace _T() macro with TEXT() macro, throughout.
|
||||||
|
Replace, _stprintf with wsprintf, throughout.
|
||||||
|
|
||||||
2004-03-27 Hosaka Yuji <hos@tamanegi.org>
|
2004-03-27 Hosaka Yuji <hos@tamanegi.org>
|
||||||
|
|
||||||
* include/dbt.h (DBT_DEVTYP_DEVICEINTERFACE, DBT_DEVTYP_HANDLE):
|
* include/dbt.h (DBT_DEVTYP_DEVICEINTERFACE, DBT_DEVTYP_HANDLE):
|
||||||
|
|
|
@ -142,7 +142,7 @@ directx:
|
||||||
|
|
||||||
TEST_OPTIONS = $(ALL_CFLAGS) -DWINVER=0x0666 \
|
TEST_OPTIONS = $(ALL_CFLAGS) -DWINVER=0x0666 \
|
||||||
-Wall -pedantic -Wsystem-headers -c $(srcdir)/test.c -o test.o
|
-Wall -pedantic -Wsystem-headers -c $(srcdir)/test.c -o test.o
|
||||||
.PHONY: test ddk
|
.PHONY: test ddk directx
|
||||||
test:
|
test:
|
||||||
@echo "Testing w32api..."
|
@echo "Testing w32api..."
|
||||||
@for lang in c c++ objective-c ; do \
|
@for lang in c c++ objective-c ; do \
|
||||||
|
|
|
@ -13,12 +13,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
|
|
||||||
#ifndef DXERROR
|
#ifndef DXERROR
|
||||||
#define DXERROR(v,n,d) {v, _T(n), _T(d)},
|
#define DXERROR(v,n,d) {v, TEXT(n), TEXT(d)},
|
||||||
#define DXERRORLAST(v,n,d) {v, _T(n), _T(d)}
|
#define DXERRORLAST(v,n,d) {v, TEXT(n), TEXT(d)}
|
||||||
#endif
|
#endif
|
||||||
#ifndef DXERROR8
|
#ifndef DXERROR8
|
||||||
#define DXERROR8(v,n,d)
|
#define DXERROR8(v,n,d)
|
||||||
|
@ -726,7 +724,7 @@ HRESULT __stdcall DXTrace(char *strFile, DWORD dwLine, HRESULT hr,
|
||||||
DebugMessage = (TCHAR *)malloc((strlen(strFile) + (strMsg ? _tcslen(strMsg) : 0) + _tcslen(ErrorName) + 48) * sizeof(TCHAR));
|
DebugMessage = (TCHAR *)malloc((strlen(strFile) + (strMsg ? _tcslen(strMsg) : 0) + _tcslen(ErrorName) + 48) * sizeof(TCHAR));
|
||||||
if (DebugMessage == 0)
|
if (DebugMessage == 0)
|
||||||
return hr;
|
return hr;
|
||||||
_stprintf(DebugMessage, _T("%hs(%Lu): %s (hr=%s(0x%Lx))"), strFile, dwLine, (strMsg ? strMsg : _T("")) ErrorName, hr);
|
wsprintf(DebugMessage, TEXT("%hs(%Lu): %s (hr=%s(0x%Lx))"), strFile, dwLine, (strMsg ? strMsg : TEXT("")) ErrorName, hr);
|
||||||
OutputDebugString(DebugMessage);
|
OutputDebugString(DebugMessage);
|
||||||
free(DebugMessage);
|
free(DebugMessage);
|
||||||
|
|
||||||
|
@ -737,11 +735,11 @@ HRESULT __stdcall DXTrace(char *strFile, DWORD dwLine, HRESULT hr,
|
||||||
DebugMessage = (TCHAR *)malloc((strlen(strFile) + (strMsg ? _tcslen(strMsg) : 0) + _tcslen(ErrorName) + 60) * sizeof(TCHAR));
|
DebugMessage = (TCHAR *)malloc((strlen(strFile) + (strMsg ? _tcslen(strMsg) : 0) + _tcslen(ErrorName) + 60) * sizeof(TCHAR));
|
||||||
if (DebugMessage == 0)
|
if (DebugMessage == 0)
|
||||||
return DXERROR_NOT_ENOUGH_MEMORY;
|
return DXERROR_NOT_ENOUGH_MEMORY;
|
||||||
_stprintf(DebugMessage,
|
wsprintf(DebugMessage,
|
||||||
_T("File: %hs\nLine: %Lu\nError Code: %s(0x%Lx)\nCalling: %s\n"
|
TEXT("File: %hs\nLine: %Lu\nError Code: %s(0x%Lx)\nCalling: %s\n"
|
||||||
"Do you want to debug the application?"), strFile, dwLine,
|
"Do you want to debug the application?"), strFile, dwLine,
|
||||||
ErrorName, hr, (strMsg ? strMsg : _T("")));
|
ErrorName, hr, (strMsg ? strMsg : TEXT("")));
|
||||||
Result = MessageBox(0, DebugMessage, _T("Unexpected error encountred"), MB_YESNO | MB_ICONDXERROR);
|
Result = MessageBox(0, DebugMessage, TEXT("Unexpected error encountred"), MB_YESNO | MB_ICONDXERROR);
|
||||||
if (Result == 0)
|
if (Result == 0)
|
||||||
return hr;
|
return hr;
|
||||||
if (Result == IDYES)
|
if (Result == IDYES)
|
||||||
|
@ -756,16 +754,16 @@ HRESULT __stdcall DXTrace(char *strFile, DWORD dwLine, HRESULT hr,
|
||||||
const TCHAR *ErrorName = DXGetErrorString(hr);
|
const TCHAR *ErrorName = DXGetErrorString(hr);
|
||||||
TCHAR DebugMessage[4096];
|
TCHAR DebugMessage[4096];
|
||||||
|
|
||||||
_stprintf(DebugMessage, _T("%hs(%Lu): %s (hr=%s(0x%Lx))"), strFile, dwLine, (strMsg ? strMsg : _T("")), ErrorName, hr);
|
wsprintf(DebugMessage, TEXT("%hs(%Lu): %s (hr=%s(0x%Lx))"), strFile, dwLine, (strMsg ? strMsg : TEXT("")), ErrorName, hr);
|
||||||
OutputDebugString(DebugMessage);
|
OutputDebugString(DebugMessage);
|
||||||
if (bPopMsgBox)
|
if (bPopMsgBox)
|
||||||
{
|
{
|
||||||
int Result;
|
int Result;
|
||||||
_stprintf(DebugMessage,
|
wsprintf(DebugMessage,
|
||||||
_T("File: %hs\nLine: %Lu\nError Code: %s(0x%Lx)\nCalling: %s\n"
|
TEXT("File: %hs\nLine: %Lu\nError Code: %s(0x%Lx)\nCalling: %s\n"
|
||||||
"Do you want to debug the application?"), strFile, dwLine,
|
"Do you want to debug the application?"), strFile, dwLine,
|
||||||
ErrorName, hr, (strMsg ? strMsg : _T("")));
|
ErrorName, hr, (strMsg ? strMsg : TEXT("")));
|
||||||
Result = MessageBox(0, DebugMessage, _T("Unexpected error encountred"), MB_YESNO | MB_ICONERROR);
|
Result = MessageBox(0, DebugMessage, TEXT("Unexpected error encountred"), MB_YESNO | MB_ICONERROR);
|
||||||
if (Result == IDYES)
|
if (Result == IDYES)
|
||||||
DebugBreak();
|
DebugBreak();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue