]> pd.if.org Git - pdclib/blobdiff - platform/win32/functions/_PDCLIB/_PDCLIB_w32errno.c
dos2unix
[pdclib] / platform / win32 / functions / _PDCLIB / _PDCLIB_w32errno.c
index 6a7bc019cfb5980d40139bccce5ae79003d996b9..8f2c8020c8edae0e902ec7973b56d6606c0e12e9 100644 (file)
@@ -1,57 +1,57 @@
-/* _PDCLIB_allocpages( int const )\r
-\r
-   This file is part of the Public Domain C Library (PDCLib).\r
-   Permission is granted to use, modify, and / or redistribute at will.\r
-*/\r
-\r
-/* This is a stub implementation of _PDCLIB_allocpages\r
-*/\r
-\r
-#ifndef REGTEST\r
-#include <errno.h>\r
-#include <wchar.h> // Watcom bug: winnt.h assumes string.h defines wchar_t\r
-#include <windows.h>\r
-\r
-void _PDCLIB_w32errno(void);\r
-\r
-void _PDCLIB_w32errno(void)\r
-{\r
-    // Not exhaustive\r
-    switch(GetLastError()) {\r
-        case ERROR_SUCCESS:\r
-            return;\r
-        case ERROR_FILE_NOT_FOUND:\r
-        case ERROR_PATH_NOT_FOUND:\r
-        case ERROR_INVALID_DRIVE:\r
-            errno = ENOENT; break;\r
-        case ERROR_TOO_MANY_OPEN_FILES:\r
-            errno = EMFILE; break;\r
-        case ERROR_ACCESS_DENIED:\r
-        case ERROR_WRITE_PROTECT:\r
-            errno = EPERM; break;\r
-        case ERROR_INVALID_HANDLE:\r
-            errno = EBADF; break;\r
-        case ERROR_NOT_ENOUGH_MEMORY:\r
-        case ERROR_OUTOFMEMORY:\r
-            errno = ENOMEM; break;\r
-        case ERROR_NOT_READY:\r
-            errno = EAGAIN; break;\r
-        case ERROR_BAD_LENGTH:\r
-            errno = EINVAL; break;\r
-        default:\r
-            // TODO: reconsider what to use here?\r
-            errno = ENOSYS; break;\r
-    }\r
-}\r
-\r
-#endif\r
-\r
-#ifdef TEST\r
-#include "_PDCLIB_test.h"\r
-\r
-int main( void )\r
-{\r
-    return TEST_RESULTS;\r
-}\r
-\r
-#endif\r
+/* _PDCLIB_allocpages( int const )
+
+   This file is part of the Public Domain C Library (PDCLib).
+   Permission is granted to use, modify, and / or redistribute at will.
+*/
+
+/* This is a stub implementation of _PDCLIB_allocpages
+*/
+
+#ifndef REGTEST
+#include <errno.h>
+#include <wchar.h> // Watcom bug: winnt.h assumes string.h defines wchar_t
+#include <windows.h>
+
+void _PDCLIB_w32errno(void);
+
+void _PDCLIB_w32errno(void)
+{
+    // Not exhaustive
+    switch(GetLastError()) {
+        case ERROR_SUCCESS:
+            return;
+        case ERROR_FILE_NOT_FOUND:
+        case ERROR_PATH_NOT_FOUND:
+        case ERROR_INVALID_DRIVE:
+            errno = ENOENT; break;
+        case ERROR_TOO_MANY_OPEN_FILES:
+            errno = EMFILE; break;
+        case ERROR_ACCESS_DENIED:
+        case ERROR_WRITE_PROTECT:
+            errno = EPERM; break;
+        case ERROR_INVALID_HANDLE:
+            errno = EBADF; break;
+        case ERROR_NOT_ENOUGH_MEMORY:
+        case ERROR_OUTOFMEMORY:
+            errno = ENOMEM; break;
+        case ERROR_NOT_READY:
+            errno = EAGAIN; break;
+        case ERROR_BAD_LENGTH:
+            errno = EINVAL; break;
+        default:
+            // TODO: reconsider what to use here?
+            errno = ENOSYS; break;
+    }
+}
+
+#endif
+
+#ifdef TEST
+#include "_PDCLIB_test.h"
+
+int main( void )
+{
+    return TEST_RESULTS;
+}
+
+#endif