Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b71596

Browse files
committed
This fixes clashing defines of ERROR. On win32, winapi.h is included, which
includes windows.h, which #defines ERROR to 0. PostgreSQL's logging functions define ERROR to -1. This patch redefines ERROR to -1 to avoid current or future breakage of the logging functions. Gerhard H?ring
1 parent e9f5463 commit 0b71596

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/include/libpq/pqcomm.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $Id: pqcomm.h,v 1.58 2001/08/21 00:33:27 momjian Exp $
12+
* $Id: pqcomm.h,v 1.59 2001/09/06 03:18:12 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -19,6 +19,11 @@
1919
#include <sys/types.h>
2020
#ifdef WIN32
2121
#include <winsock.h>
22+
/* workaround for clashing defines of "ERROR" */
23+
#ifdef ELOG_H
24+
#undef ERROR
25+
#define ERROR (-1)
26+
#endif
2227
#else /* not WIN32 */
2328
#include <sys/socket.h>
2429
#ifdef HAVE_SYS_UN_H

0 commit comments

Comments
 (0)