I pushed r4950 for __int128 and clang.  Please correct further if necessary.

--
O.S.

On Tue, Apr 10, 2012 at 9:46 AM, Kai Tietz <[email protected]> wrote:
> Sure,  thanks for the correction.
>
> Kai
>
> 2012/4/9 Jim Michaels <[email protected]>:
>>
>> #if !defined (__SIZEOF_INT128__) && (__clang_major__ ==3) &&
>> (__clang_minor__ >= 1)
>> #define __SIZEOF_INT128__ 16
>> #endif
>>
>>  then it becomes undefined for any time clang is
>> <=3.0
>>>=4.0
>> I am not sure this is the logic you want.  perhaps it should be
>> I am not a C compiler expert here, but I should think you would want to
>> continue the feature beyond 3.x.  so how about
>>
>> #if (!defined (__SIZEOF_INT128__) && (__clang_major__ ==3)) &&
>> (__clang_minor__ >= 1)) || (!defined (__SIZEOF_INT128__) && (__clang_major__
>>>=4)))
>> #define __SIZEOF_INT128__ 16
>> #endif
>>
>> this would cover 4.x and up as well.
>>
>>
>> ________________________________
>> From: Kai Tietz <[email protected]>
>> To: [email protected]
>> Sent: Sunday, April 8, 2012 7:23 AM
>> Subject: Re: [Mingw-w64-public] Problem with __int128 and Clang
>>
>> 2012/4/8 Ruben Van Boxem <[email protected]>:
>>> 2012/4/8 Ozkan Sezer <[email protected]>
>>>>
>>>> On Sun, Apr 8, 2012 at 3:56 PM, Ruben Van Boxem
>>>> <[email protected]> wrote:
>>>> > 2012/4/8 Ozkan Sezer <[email protected]>
>>>> >>
>>>> >> On Sun, Apr 8, 2012 at 3:37 PM, Ruben Van Boxem
>>>> >> <[email protected]> wrote:
>>>> >> > 2012/4/8 Ozkan Sezer <[email protected]>
>>>> >> >>
>>>> >> >> On Sun, Apr 8, 2012 at 3:14 PM, Ruben Van Boxem
>>>> >> >> <[email protected]> wrote:
>>>> >> >> > Hi,
>>>> >> >> >
>>>> >> >> > Clang doesn't support the __int128 stuff, and the _mingw.h header
>>>> >> >> > is
>>>> >> >> > doing a
>>>> >> >> > typedef that Clang does not understand.
>>>> >> >> >
>>>> >> >> > It is on line 218 of _mingw.h:
>>>> >> >> >
>>>> >> >> > #ifndef __SIZEOF_INT128__
>>>> >> >> > typedef int __int128 __attribute__ ((__mode__ (TI)));
>>>> >> >> > #endif
>>>> >> >> >
>>>> >> >> > should be:
>>>> >> >> >
>>>> >> >> > #if !defined(__SIZEOF_INT128__) && !defined(__clang__)
>>>> >> >> > typedef int __int128 __attribute__ ((__mode__ (TI)));
>>>> >> >> > #endif
>>>> >> >> >
>>>> >> >> > Does this seem plausible?
>>>> >> >>
>>>> >> >> __mode__ (TI) is the problem, I guess?  If that is the case, one
>>>> >> >> would
>>>> >> >> like to know whether they would support it in the future.
>>>> >> >
>>>> >> >
>>>> >> > Doesn't seem so:
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > M:/Development/mingw64/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\_mingw.h:220:13:
>>>> >> > error: cannot combine with previous 'int' declaration specifier
>>>> >> > typedef int __int128;// __attribute__ ((__mode__ (TI)));
>>>> >> >             ^
>>>> >> > 1 error generated.
>>>> >> >
>>>> >> > A small test also shows that __int128 is a Clang builtin type. So
>>>> >> > the
>>>> >>
>>>> >> Ah. Then do they not define a macro indicating the type's size
>>>> >> like __SIZEOF_INT128__ from gcc? If not, then your suggestion seem
>>>> >> as the right solution to me
>>>> >
>>>> >
>>>> > I can't find anything in the source, and no compiler-defined macro's.
>>>> > Only
>>>> > for the char/short/int/long/wchar_t types. I have no idea how they
>>>> > implement
>>>> > it or how it works. sizeof(__int128) returns 16, which seems right.
>>>>
>>>> I see. Then the additional clang ifdef seems as the the right solution.
>>>>
>>>> BTW, is it a yet-to-be-released clang 3.1 thing (judging from the
>>>> command line you pasted here), or do the older versions of clang
>>>> have it?
>>>
>>>
>>> It's very new, in order to match libstdc++ changes incorporating the
>>> change
>>> on GCC side:
>>>
>>> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120402/055712.html
>>>
>>> So I guess only Clang 3.1 is affected. These are the version macros:
>>> (__clang_major__ ==3) && (__clang_minor__ >= 1)
>>>
>>> My version check thinking isn't working today and I gotta go very soon,
>>> sorry.
>>>
>>> Ruben
>>
>> Proper fix for Clang would be in _mingw.h.in header before the first
>> use of __SIZEOF_INT128__.
>>
>> #if !defined (__SIZEOF_INT128__) && (__clang_major__ ==3) &&
>> (__clang_minor__ >= 1)
>> #define __SIZEOF_INT128__ 16
>> #endif
>>
>>
>> Regards,
>> Kai
>>
>>
>

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to