pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15167: error C2365: 'errcode' : redefi nition; previous definition
4+ messages / 3 participants
[nested] [flat]

* BUG #15167: error C2365: 'errcode' : redefi nition; previous definition
@ 2018-04-23 06:29  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Bug reporting form @ 2018-04-23 06:29 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: mixtrue@gmail.com

The following bug has been logged on the website:

Bug reference:      15167
Logged by:          Hao LI
Email address:      mixtrue@gmail.com
PostgreSQL version: 10.3
Operating system:   windows 7
Description:        

Platform: windows 7 and vs 2008 

The source code checkout from : https://github.com/postgres/postgres.git.
and the git log as following:
commit 9cad926eb876a30d58a5b39789098da83a6ef91c

I run the command from src\tools\msvc\build.pl DEBUG, and get error as
following: 

d:\work\postgres\src\include\utils/elog.h(131): error C2365: 'errcode' :
redefinition; previous definition was 'typedef'.

Best Regards, 

Hao.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15167: error C2365: 'errcode' : redefi nition; previous definition
@ 2018-04-23 06:49  Hao Lee <mixtrue@gmail.com>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Hao Lee @ 2018-04-23 06:49 UTC (permalink / raw)
  To: Mixtrue <mixtrue@gmail.com>; pgsql-bugs@lists.postgresql.org

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'



On Mon, Apr 23, 2018 at 2:29 PM, PG Bug reporting form <
noreply@postgresql.org> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      15167
> Logged by:          Hao LI
> Email address:      mixtrue@gmail.com
> PostgreSQL version: 10.3
> Operating system:   windows 7
> Description:
>
> Platform: windows 7 and vs 2008
>
> The source code checkout from : https://github.com/postgres/postgres.git.
> and the git log as following:
> commit 9cad926eb876a30d58a5b39789098da83a6ef91c
>
> I run the command from src\tools\msvc\build.pl DEBUG, and get error as
> following:
>
> d:\work\postgres\src\include\utils/elog.h(131): error C2365: 'errcode' :
> redefinition; previous definition was 'typedef'.
>
> Best Regards,
>
> Hao.
>
>


-- 
A Database Kernel Engineer.                               @
http://www.leehao.org.
MyBook: Inside into PostgreSQL Query Engine.     @amazon China
<https://www.amazon.cn/%E5%9B%BE%E4%B9%A6/dp/B01KG96FVC/ref=sr_1_1?ie=UTF8&qid=1496719538&sr=...;

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15167: error C2365: 'errcode' : redefi nition; previous definition
@ 2018-04-23 07:48  Heikki Linnakangas <hlinnaka@iki.fi>
  parent: Hao Lee <mixtrue@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Heikki Linnakangas @ 2018-04-23 07:48 UTC (permalink / raw)
  To: Hao Lee <mixtrue@gmail.com>; pgsql-bugs@lists.postgresql.org

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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15167: error C2365: 'errcode' : redefi nition; previous definition
@ 2018-04-23 08:28  Hao Lee <mixtrue@gmail.com>
  parent: Heikki Linnakangas <hlinnaka@iki.fi>
  0 siblings, 0 replies; 4+ messages in thread

From: Hao Lee @ 2018-04-23 08:28 UTC (permalink / raw)
  To: Heikki Linnakangas <hlinnaka@iki.fi>; +Cc: pgsql-bugs@lists.postgresql.org

yes, the code you mentioned, on my env. as following:

/*
 * 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
----------------------------------------------------------
the ms version info  as following:
Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1

Installed Edition: Professional

Microsoft Visual C++ 2008   91605-270-4948377-60248
Microsoft Visual C++ 2008

-----------------------------------------------------------------------
the value of _MSC_VER  is 1500.



On Mon, Apr 23, 2018 at 3:48 PM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:

> 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
>



-- 
A Database Kernel Engineer.                               @
http://www.leehao.org.
MyBook: Inside into PostgreSQL Query Engine.     @amazon China
<https://www.amazon.cn/%E5%9B%BE%E4%B9%A6/dp/B01KG96FVC/ref=sr_1_1?ie=UTF8&qid=1496719538&sr=...;

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-04-23 08:28 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 06:29 BUG #15167: error C2365: 'errcode' : redefi nition; previous definition PG Bug reporting form <noreply@postgresql.org>
2018-04-23 06:49 ` Hao Lee <mixtrue@gmail.com>
2018-04-23 07:48   ` Heikki Linnakangas <hlinnaka@iki.fi>
2018-04-23 08:28     ` Hao Lee <mixtrue@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox