niXman | 9 Sep 09:38 2012
Picon

__ has_include() macro implementation can be accepted in GCC?

Hello,

__has_include() [1] macro implementation can be accepted in GCC(may be
as GCC extension)?
Is there any sense to send a patch?

[1] http://clang.llvm.org/docs/LanguageExtensions.html#__has_include

--

-- 
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

Bryan Hundven | 9 Sep 09:55 2012
Picon

Re: __ has_include() macro implementation can be accepted in GCC?

On Sun, Sep 9, 2012 at 12:38 AM, niXman <i.nixman <at> gmail.com> wrote:
> Hello,
>
> __has_include() [1] macro implementation can be accepted in GCC(may be
> as GCC extension)?
> Is there any sense to send a patch?
>
>
> [1] http://clang.llvm.org/docs/LanguageExtensions.html#__has_include

I would also be interested in an answer to see if this can become a
part of gcc (as well as the has_warning), but you could just check the
defines a header usually makes:

std_header.h:
#ifndef STD_HEADER_H
#define STD_HEADER_H
...
<stuff>
...
#endif /* STD_HEADER_H

my_c_file.c:
...
#ifdef STD_HEADER_H
<do some stuff that can only be done if that header exists>
#else
<workaround>
#endif
...
(Continue reading)

niXman | 9 Sep 09:59 2012
Picon

Re: __ has_include() macro implementation can be accepted in GCC?

2012/9/9 Bryan Hundven:
> but you could just check the defines a header usually makes:
> ...

This is a bad idea.

--

-- 
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

Georg-Johann Lay | 9 Sep 14:12 2012
Picon

Re: __ has_include() macro implementation can be accepted in GCC?

Bryan Hundven schrieb:
> niXman wrote:
>>
>> __has_include() [1] macro implementation can be accepted in GCC(may be
>> as GCC extension)?
>> Is there any sense to send a patch?
>>
>> [1] http://clang.llvm.org/docs/LanguageExtensions.html#__has_include
> 
> I would also be interested in an answer to see if this can become a
> part of gcc (as well as the has_warning)

Also interesting in the __has_builtin.

In the avr backend I added built-in defines for each target-specific
built-in function and built-in type:

    "For each built-in function for AVR, there is an equally named,
     uppercase built-in macro defined. That way users can easily query
     if or if not a specific built-in is implemented or not.
     For example, if __builtin_avr_nop is available the macro
     __BUILTIN_AVR_NOP is defined to 1 and undefined otherwise."

I think it is much more convenient and and consistent across
architectures to have something like __has_builtin or have the
builtin machinery define such macros in a consistent nomenclature.

> but you could just check the  defines a header usually makes:
> 
> std_header.h:
(Continue reading)

niXman | 10 Sep 14:28 2012
Picon

Re: __ has_include() macro implementation can be accepted in GCC?

2012/9/9 niXman:
> Hello,
>
> __has_include() [1] macro implementation can be accepted in GCC(may be
> as GCC extension)?
> Is there any sense to send a patch?

Ping?
Did any of the developers can answer me?

--

-- 
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

Ian Lance Taylor | 10 Sep 20:42 2012
Picon

Re: __ has_include() macro implementation can be accepted in GCC?

On Sun, Sep 9, 2012 at 12:38 AM, niXman <i.nixman <at> gmail.com> wrote:
>
> __has_include() [1] macro implementation can be accepted in GCC(may be
> as GCC extension)?
> Is there any sense to send a patch?

Sure, sounds like a useful feature to me.

Ian


Gmane