Skip to content

Conversation

@nehaljwani
Copy link

VS2015 already has a definition for snprintf. This results into compilation error:

D:\work\leveldb-1.20\port/port_win.h(35): note: see previous definition of 'snprintf'
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration

This patch makes the definition of snprintf and vsnprintf conditional,
based on the value of the macro _MSC_VER

@sipa
Copy link

sipa commented Aug 1, 2017

utACK

@laanwj
Copy link
Member

laanwj commented Jan 16, 2019

Needs rebase after #14

VS2015 already has a definition for snprintf. This results into compilation error:

D:\work\leveldb-1.20\port/port_win.h(35): note: see previous definition of 'snprintf'
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration

This patch makes the definition of snprintf and vsnprintf conditional,
based on the value of the macro _MSC_VER
@nehaljwani
Copy link
Author

@laanwj I have rebased my changes.

@laanwj
Copy link
Member

laanwj commented Mar 21, 2019

Thank you. utACK a3ae607

@laanwj laanwj merged commit a3ae607 into bitcoin-core:bitcoin-fork Mar 21, 2019
laanwj added a commit that referenced this pull request Mar 21, 2019
a3ae607 Make {v}snprintf definition dependent on _MSC_VER (Nehal J Wani)

Pull request description:

  `VS2015` already has a definition for `snprintf`. This results into compilation error:

  ```
  D:\work\leveldb-1.20\port/port_win.h(35): note: see previous definition of 'snprintf'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
  ```

  This patch makes the definition of `snprintf` and `vsnprintf` conditional,
  based on the value of the macro `_MSC_VER`

Tree-SHA512: 4bae38f584057cac1c2aebe7958852be391ba23ea7d9062bab5cc90f8951bf63ed02aaa195e706a3db2c4f9876c495081642f19d7523659c379cdbbc948eba6a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants