Skip to content

Commit beca62e

Browse files
committed
Attempt 2. This time actually reading my own diffs before committing.
1 parent b9f82d8 commit beca62e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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)