Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(416569)

Issue 524: snprintf and macro redefintion patch for MSVC

Can't Edit
Can't Publish+Mail
Start Review
Created:
3 years, 11 months ago by negge
Modified:
3 years, 11 months ago
Reviewers:
randomguy
Visibility:
Public.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Macro redefinition on msvc #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/internal.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
M src/odintrin.h View 1 2 chunks +12 lines, -2 lines 0 comments Download

Messages

Total messages: 2
negge
Here are my initial comments, I am still working to test this. http://review.xiph.org/524/diff/831/src/odintrin.h File src/odintrin.h ...
3 years, 11 months ago #1
randomguy
3 years, 11 months ago #2
On 2014/11/13 18:55:44, negge wrote:
> Here are my initial comments, I am still working to test this.
> 
> http://review.xiph.org/524/diff/831/src/odintrin.h
> File src/odintrin.h (right):
> 
> http://review.xiph.org/524/diff/831/src/odintrin.h#newcode35
> src/odintrin.h:35: #if !defined(_MSC_VER)
> What happens if M_LOG2E is not defined and this is not _MSC_VER?  Why wouldn't
> we want M_LOG2E defined for MSC_VER if it is not currently defined?
> 
> http://review.xiph.org/524/diff/831/src/odintrin.h#newcode129
> src/odintrin.h:129: #define snprintf _snprintf
> I will need to install MSVC in a VM to test this.

you are absolutely right about the M_LOG2E its an ugly hack, I tried this in
VS2008 team and VS2010 ultimate, in both cases the file <math.h> explicitily
defined the macro M_LOG2E,(please note that this file is included before daalas
own M_LOG2E def) however even with the #if !defined guard, I got the same error
on both compilers, "Macro redefinition"

will keep looking at this issue in order to provide a better patch
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld