Posted to tcl by kostix at Sun Apr 01 22:17:17 GMT 2007view raw
- #ifdef WIN32
- LPVOID sMsg;
- Tcl_DString *dsPtr;
- Tcl_DStringInit(dsPtr);
- FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER
- | FORMAT_MESSAGE_FROM_SYSTEM
- | FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)&sMsg, 0, NULL);
- Tcl_UniCharToUtfDString(sMsg, -1, dsPtr);
- errObj = Tcl_NewStringObj(prefix, -1);
- Tcl_AppendStringsToObj(errObj, ": ", Tcl_DStringValue(dsPtr), NULL);
- LocalFree(sMsg);
- Tcl_DStringFree(dsPtr);
- #elif defined(HAVE_STRERROR)