crt: Rename dxerr.c to dxerr.def.h
This follows crt/complex. Accordingly changes dxerr{8,9}{,w}.c and
Makefile.am.
Signed-off-by: Zhongteng Gui <dragon-archer@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index f0cd778..bdba12b 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -4,7 +4,6 @@
# Done: 32-bit runtime compatibility
# Done: fix make dist
# TODO: Use $(TAR) instead of tar?
-# TODO: Find a better way to handle dxerr.c -- make it dxerr.h and add to sources list?
#
#Use AM_MAINTAINER_MODE in configure.ac to disable autoreconf
@@ -100,8 +99,8 @@
src_libdinput=libsrc/dinput_kbd.c libsrc/dinput_joy.c libsrc/dinput_joy2.c libsrc/dinput_mouse.c libsrc/dinput_mouse2.c
src_libdinput8=libsrc/dinput_private.h libsrc/dinput_joy.c libsrc/dinput_joy2.c libsrc/dinput_mouse.c libsrc/dinput_mouse2.c libsrc/dinput_kbd.c
src_libdmoguids=libsrc/dmoguids.c
-src_libdxerr8=libsrc/dxerr8.c libsrc/dxerr8w.c
-src_libdxerr9=libsrc/dxerr9.c libsrc/dxerr9w.c
+src_libdxerr8=libsrc/dxerr8.c libsrc/dxerr8w.c libsrc/dxerr.def.h
+src_libdxerr9=libsrc/dxerr9.c libsrc/dxerr9w.c libsrc/dxerr.def.h
src_libmfuuid=libsrc/mfuuid.c
src_libmsxml2=libsrc/msxml2.c
src_libmsxml6=libsrc/msxml6.c
@@ -1470,7 +1469,6 @@
#
temp= \
-dxerr.c \
test.c
lib32_LIBRARIES = lib32/libkernel32.a
@@ -2267,7 +2265,6 @@
#
temp= \
-dxerr.c \
test.c
libarm32_LIBRARIES = libarm32/libkernel32.a
@@ -2588,7 +2585,6 @@
#
temp= \
-dxerr.c \
test.c
libarm64_LIBRARIES = libarm64/libkernel32.a
@@ -4564,7 +4560,7 @@
# Installation options
#
-noinst_HEADERS = libsrc/dxerr.c \
+noinst_HEADERS = \
include/internal.h include/sect_attribs.h
diff --git a/mingw-w64-crt/libsrc/dxerr.c b/mingw-w64-crt/libsrc/dxerr.def.h
similarity index 99%
rename from mingw-w64-crt/libsrc/dxerr.c
rename to mingw-w64-crt/libsrc/dxerr.def.h
index a328bcf..1e40251 100644
--- a/mingw-w64-crt/libsrc/dxerr.c
+++ b/mingw-w64-crt/libsrc/dxerr.def.h
@@ -1,6 +1,6 @@
/*
- dxerr.c - DirectX 8 & 9 Error Functions
+ dxerr.def.h - DirectX 8 & 9 Error Functions
Written by Filip Navara <xnavara@volny.cz>
@@ -723,7 +723,7 @@
#if 0
const TCHAR *ErrorName = DXGetErrorString9(hr);
TCHAR *DebugMessage;
-
+
DebugMessage = (TCHAR *)malloc((strlen(strFile) + (strMsg ? _tcslen(strMsg) : 0) + _tcslen(ErrorName) + 48) * sizeof(TCHAR));
if (DebugMessage == 0)
return hr;
@@ -738,10 +738,10 @@
DebugMessage = (TCHAR *)malloc((strlen(strFile) + (strMsg ? _tcslen(strMsg) : 0) + _tcslen(ErrorName) + 60) * sizeof(TCHAR));
if (DebugMessage == 0)
return DXERROR_NOT_ENOUGH_MEMORY;
- wsprintf(DebugMessage,
+ wsprintf(DebugMessage,
TEXT("File: %hs\nLine: %Lu\nError Code: %s(0x%Lx)\nCalling: %s\n"
"Do you want to debug the application?"), strFile, dwLine,
- ErrorName, hr, (strMsg ? strMsg : TEXT("")));
+ ErrorName, hr, (strMsg ? strMsg : TEXT("")));
Result = MessageBox(0, DebugMessage, TEXT("Unexpected error encountred"), MB_YESNO | MB_ICONDXERROR);
if (Result == 0)
return hr;
@@ -756,16 +756,16 @@
#else
const TCHAR *ErrorName = DXGetErrorString(hr);
TCHAR DebugMessage[4096];
-
+
wsprintf(DebugMessage, TEXT("%hs(%Lu): %s (hr=%s(0x%Lx))"), strFile, dwLine, (strMsg ? strMsg : TEXT("")), ErrorName, hr);
OutputDebugString(DebugMessage);
if (bPopMsgBox)
{
int Result;
- wsprintf(DebugMessage,
+ wsprintf(DebugMessage,
TEXT("File: %hs\nLine: %Lu\nError Code: %s(0x%Lx)\nCalling: %s\n"
"Do you want to debug the application?"), strFile, dwLine,
- ErrorName, hr, (strMsg ? strMsg : TEXT("")));
+ ErrorName, hr, (strMsg ? strMsg : TEXT("")));
Result = MessageBox(0, DebugMessage, TEXT("Unexpected error encountred"), MB_YESNO | MB_ICONERROR);
if (Result == IDYES)
DebugBreak();
diff --git a/mingw-w64-crt/libsrc/dxerr8.c b/mingw-w64-crt/libsrc/dxerr8.c
index 6794e32..7ccbdc3 100644
--- a/mingw-w64-crt/libsrc/dxerr8.c
+++ b/mingw-w64-crt/libsrc/dxerr8.c
@@ -15,4 +15,4 @@
#define DXTrace DXTraceA
#define DXERROR8(v,n,d) {v, n, d},
#define DXERROR8LAST(v,n,d) {v, n, d}
-#include "dxerr.c"
+#include "dxerr.def.h"
diff --git a/mingw-w64-crt/libsrc/dxerr8w.c b/mingw-w64-crt/libsrc/dxerr8w.c
index 207bd88..e4b0aac 100644
--- a/mingw-w64-crt/libsrc/dxerr8w.c
+++ b/mingw-w64-crt/libsrc/dxerr8w.c
@@ -17,5 +17,5 @@
#define DXTrace DXTraceW
#define DXERROR8(v,n,d) {v, L##n, L##d},
#define DXERROR8LAST(v,n,d) {v, L##n, L##d}
-#include "dxerr.c"
+#include "dxerr.def.h"
diff --git a/mingw-w64-crt/libsrc/dxerr9.c b/mingw-w64-crt/libsrc/dxerr9.c
index af2d859..c8cc30f 100644
--- a/mingw-w64-crt/libsrc/dxerr9.c
+++ b/mingw-w64-crt/libsrc/dxerr9.c
@@ -15,4 +15,4 @@
#define DXTrace DXTraceA
#define DXERROR9(v,n,d) {v, n, d},
#define DXERROR9LAST(v,n,d) {v, n, d}
-#include "dxerr.c"
+#include "dxerr.def.h"
diff --git a/mingw-w64-crt/libsrc/dxerr9w.c b/mingw-w64-crt/libsrc/dxerr9w.c
index 9556598..8cdebc0 100644
--- a/mingw-w64-crt/libsrc/dxerr9w.c
+++ b/mingw-w64-crt/libsrc/dxerr9w.c
@@ -17,5 +17,5 @@
#define DXTrace DXTraceW
#define DXERROR9(v,n,d) {v, L##n, L##d},
#define DXERROR9LAST(v,n,d) {v, L##n, L##d}
-#include "dxerr.c"
+#include "dxerr.def.h"