[Mesa-dev] [PATCH 1/2] util: rework _MSC_VER >= 1200 checks
Jose Fonseca
jfonseca at vmware.com
Fri Mar 6 06:48:42 PST 2015
On 06/03/15 14:26, Brian Paul wrote:
> On 03/06/2015 05:34 AM, Emil Velikov wrote:
>> Replace the _MSC_VER >= 1200 with defined (_MSC_VER) and compact if/else
>> statements. We require MSVC 2008 or later with commit 46110c5d564.
>>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>> src/util/macros.h | 8 +++-----
>> 1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/util/macros.h b/src/util/macros.h
>> index b862bfd..63daba3 100644
>> --- a/src/util/macros.h
>> +++ b/src/util/macros.h
>> @@ -73,15 +73,13 @@ do { \
>> assert(!str); \
>> __builtin_unreachable(); \
>> } while (0)
>> -#elif _MSC_VER >= 1200
>> +#elif defined (_MSC_VER)
>> #define unreachable(str) \
>> do { \
>> assert(!str); \
>> __assume(0); \
>> } while (0)
>> -#endif
>> -
>> -#ifndef unreachable
>> +#else
>> #define unreachable(str) assert(!str)
>> #endif
>>
>> @@ -99,7 +97,7 @@ do { \
>> #define assume(expr) ((expr) ? ((void) 0) \
>> : (assert(!"assumption failed"), \
>> __builtin_unreachable()))
>> -#elif _MSC_VER >= 1200
>> +#elif defined (_MSC_VER)
>> #define assume(expr) __assume(expr)
>> #else
>> #define assume(expr) assert(expr)
>>
>
> Building with this patch now and looks good so far.
>
> Reviewed-by: Brian Paul <brianp at vmware.com>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=VrCTq88usK6TJnKXQg4dtWAmjnQhTyIUUn69r-98pGI&s=qu6XVEo8t4RfffgGmfDr3zUxhevQAukeEAlZ4IUXDPc&e=
>
Looks good to me too. The minimum _MSC_VER we need to worry about is
1500 -- MSVC 2008.
Jose
More information about the mesa-dev
mailing list