]> gitweb.factorcode.org Git - factor.git/commitdiff
remove error_message from windows vm
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Apr 2009 14:36:01 +0000 (09:36 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Apr 2009 14:36:01 +0000 (09:36 -0500)
vm/os-windows.c
vm/os-windows.h

index 2abc04cb3b6e0df0ad317b7c7663b13787a153ac..c917cd804d433716e3943196ae4718fe87df193c 100755 (executable)
@@ -1,39 +1,5 @@
 #include "master.h"
 
-F_STRING *get_error_message(void)
-{
-       DWORD id = GetLastError();
-       F_CHAR *msg = error_message(id);
-       F_STRING *string = from_u16_string(msg);
-       LocalFree(msg);
-       return string;
-}
-
-/* You must LocalFree() the return value! */
-F_CHAR *error_message(DWORD id)
-{
-       F_CHAR *buffer;
-       int index;
-
-       DWORD ret = FormatMessage(
-               FORMAT_MESSAGE_ALLOCATE_BUFFER |
-               FORMAT_MESSAGE_FROM_SYSTEM,
-               NULL,
-               id,
-               MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-               (LPTSTR)(void *) &buffer,
-               0, NULL);
-       if(ret == 0)
-               return error_message(GetLastError());
-
-       /* strip whitespace from end */
-       index = wcslen(buffer) - 1;
-       while(index >= 0 && isspace(buffer[index]))
-               buffer[index--] = 0;
-
-       return buffer;
-}
-
 HMODULE hFactorDll;
 
 void init_ffi(void)
index 36d350f50dc81f008008adbebb7833c430425ff3..95d41ca9a2c42147e29cfc05746cea77930694a6 100755 (executable)
@@ -42,10 +42,6 @@ typedef wchar_t F_CHAR;
 /* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */
 #define EPOCH_OFFSET 0x019db1ded53e8000LL
 
-F_STRING *get_error_message(void);
-DLLEXPORT F_CHAR *error_message(DWORD id);
-void windows_error(void);
-
 void init_ffi(void);
 void ffi_dlopen(F_DLL *dll);
 void *ffi_dlsym(F_DLL *dll, F_SYMBOL *symbol);