Bug 75336 - Don't provide inline definitions of functions available in MSVS 2013's standard library
Summary: Don't provide inline definitions of functions available in MSVS 2013's standa...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-21 19:22 UTC by hans
Modified: 2014-03-03 20:08 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch for u_math.h (1.13 KB, patch)
2014-03-01 18:32 UTC, Brian Paul
Details | Splinter Review
patch for imports.h (959 bytes, patch)
2014-03-01 18:33 UTC, Brian Paul
Details | Splinter Review

Description hans 2014-02-21 19:22:13 UTC
MSVS 2013 provides functions that were previously not available in the standard library. Mesa provides inline definitions for these when _MSC_VER is set. For example, http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/main/imports.h#n136

Clang warns about this "non-static declaration followed by static declaration" situation:

..\..\third_party\mesa\src\src\mesa\main/imports.h(148,20) :  warning(clang): static declaration of 'truncf' follows non-static declaration
static inline float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); }
                    ^
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(597,22) :  note(clang): previous declaration is here
_CRTIMP float __cdecl truncf(_In_ float _X);
                      ^

These declarations should probably be guarded by #if _MSC_VER < 1800.

(Chromium worked around the warning here: http://src.chromium.org/viewvc/chrome?revision=252594&view=revision)
Comment 1 Brian Paul 2014-03-01 18:32:10 UTC
Created attachment 94935 [details] [review]
patch for u_math.h
Comment 2 Brian Paul 2014-03-01 18:33:04 UTC
Created attachment 94936 [details] [review]
patch for imports.h

Can you verify that these two patches fixes the issue for you with Mesa git master?

If so, I'll also tag them for inclusion in the next 10.1.x release too.
Comment 3 hans 2014-03-03 18:38:48 UTC
Thanks Brian. I can confirm that those patches fixes the issue on the Mesa version we are using (Chromium is pretty far behind the Mesa git master so I don't have an easy way of testing that.)
Comment 4 Brian Paul 2014-03-03 20:08:30 UTC
OK, the patches are in Mesa git/master now (bf2566032589e and 837da9bdae) and tagged for inclusion in future 10.0.x and 10.1.x releases.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.