summaryrefslogtreecommitdiff
path: root/src/include/port/win32.h
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-01-23 03:28:49 +0000
committerBruce Momjian <bruce@momjian.us>2007-01-23 03:28:49 +0000
commit882b9948d706af983e101166ec73bb54a7782957 (patch)
treeb49256f79389a5feeb92e1e316bae9484d808904 /src/include/port/win32.h
parent610f60a092ea178b96baebd7d4ee958c8061606e (diff)
Back out use of FormatMessage(), does error values, not exception
values. Point to /include/ntstatus.h for an exception list, rather than a URL.
Diffstat (limited to 'src/include/port/win32.h')
-rw-r--r--src/include/port/win32.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index ef515fd48b3..75583d905ac 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.68 2007/01/23 01:45:11 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.69 2007/01/23 03:28:49 momjian Exp $ */
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define WIN32_ONLY_COMPILER
@@ -140,26 +140,14 @@ int semop(int semId, struct sembuf * sops, int flag);
* Descriptions - http://www.comp.nus.edu.sg/~wuyongzh/my_doc/ntstatus.txt
* MS SDK - http://www.nologs.com/ntstatus.html
*
- * Because FormatMessage only handles NT_ERROR strings, and assumes they
- * do not have the 0xC prefix, we strip it to match this list:
- * http://msdn2.microsoft.com/en-us/library/ms681381.aspx
- *
- * When using FormatMessage():
- *
- * On MinGW, system() returns STATUS_* values. MSVC might be
- * different. To test, create a binary that does *(NULL), and
- * then create a second binary that calls it via system(),
- * and check the return value of system(). On MinGW, it is
- * 0xC0000005 == STATUS_ACCESS_VIOLATION, and 0x5 is a value
- * FormatMessage() can look up. GetLastError() does not work;
- * always zero.
+ * Some day we might want to print descriptions for the most common
+ * exceptions, rather than printing a URL. FormatMessage() can print
+ * the text of error values, but not exception values.
*/
-#define STATUS_ERROR_MASK 0xC0000000
-#define WIFEXITED(w) (((w) & 0XFFFFFF00) == 0)
-#define WIFSIGNALED(w) (!WIFEXITED(w))
-#define WEXITSTATUS(w) (w)
-#define WERRORCODE(w) ((((w) & STATUS_ERROR_MASK) == STATUS_ERROR_MASK) ? \
- ((w) & ~STATUS_ERROR_MASK) : 0)
+#define WIFEXITED(w) (((w) & 0XFFFFFF00) == 0)
+#define WIFSIGNALED(w) (!WIFEXITED(w))
+#define WEXITSTATUS(w) (w)
+#define WTERMSIG(w) (w)
#define sigmask(sig) ( 1 << ((sig)-1) )