Re: BUG #15167: error C2365: 'errcode' : redefi nition; previous definition

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Hao Lee <mixtrue(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15167: error C2365: 'errcode' : redefi nition; previous definition
Date: 2018-04-23 07:48:38
Message-ID: 5f8565d8-34a9-44c1-dd94-baf8b18a7885@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 23/04/18 02:49, Hao Lee wrote:
> The more info:
> 1>d:\postgres\src\include\utils/elog.h(131) : error C2365: 'errcode' :
> redefinition; previous definition was 'typedef'
> 1> C:\Program Files (x86)\Microsoft Visual Studio
> 9.0\VC\include\crtdefs.h(560) : see declaration of 'errcode'

In src/include/port/win32.h, we have this:

> /*
> * We need to prevent <crtdefs.h> from defining a symbol conflicting with
> * our errcode() function. Since it's likely to get included by standard
> * system headers, pre-emptively include it now.
> */
> #if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H)
> #define errcode __msvc_errcode
> #include <crtdefs.h>
> #undef errcode
> #endif

For some reason, that doesn't seem to be working as intended, on your
system. Do you see the above in src/include/pg_config_os.h ?

What version of Visual Studio or Platform SDK are you using? What is the
value of _MSC_VER on your system?

- Heikki

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Hao Lee 2018-04-23 08:28:16 Re: BUG #15167: error C2365: 'errcode' : redefi nition; previous definition
Previous Message Heikki Linnakangas 2018-04-23 07:41:47 Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least 9.5)?