Skip to content

Commit 66eea25

Browse files
committed
---
yaml --- r: 368 b: refs/heads/master c: beca62e h: refs/heads/master v: v3
1 parent a1bd656 commit 66eea25

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: b9f82d85f91169619064faf159cd33b4d7b3f353
2+
refs/heads/master: beca62e2e3db5c5540003de9aac2766a7f1ab9b9

trunk/src/rt/rust_dom.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,25 @@ rust_dom::free(void *p) {
154154
srv->free(p);
155155
}
156156

157+
#ifdef __WIN32__
158+
void
159+
rust_dom::win32_require(LPCTSTR fn, BOOL ok) {
160+
if (!ok) {
161+
LPTSTR buf;
162+
DWORD err = GetLastError();
163+
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
164+
FORMAT_MESSAGE_FROM_SYSTEM |
165+
FORMAT_MESSAGE_IGNORE_INSERTS,
166+
NULL, err,
167+
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
168+
(LPTSTR) &buf, 0, NULL );
169+
log(rust_log::ERR, "%s failed with error %ld: %s", fn, err, buf);
170+
LocalFree((HLOCAL)buf);
171+
I(this, ok);
172+
}
173+
}
174+
#endif
175+
157176
size_t
158177
rust_dom::n_live_tasks()
159178
{

0 commit comments

Comments
 (0)