public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* help on fucntion visibility
@ 2006-12-06  6:36 Irene (Shi Ying) Huang
  2006-12-06  8:51 ` Artūras Moskvinas
  0 siblings, 1 reply; 3+ messages in thread
From: Irene (Shi Ying) Huang @ 2006-12-06  6:36 UTC (permalink / raw)
  To: gcc-help

hi, 

I know that the current version gcc supports function visibility
attributes, yet some of the previous versions does not. 

Could any one kindly tell since which version is visibility attribute
supported by gcc? So that I will be able to write some conditional
macros definition code to make things more flexible? 

The macro definition is supposed to be something like:
#if ((__GNUC__ *100 +__GNUC_MINOR__) >= 303)
#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
#else
#define G_GNUC_INTERNAL
#endif

Thanks in advance. 

--Irene

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: help on fucntion visibility
  2006-12-06  6:36 help on fucntion visibility Irene (Shi Ying) Huang
@ 2006-12-06  8:51 ` Artūras Moskvinas
  2006-12-07  2:40   ` Irene (Shi Ying) Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Artūras Moskvinas @ 2006-12-06  8:51 UTC (permalink / raw)
  To: Irene (Shi Ying) Huang; +Cc: gcc-help



> 
> I know that the current version gcc supports function visibility
> attributes, yet some of the previous versions does not. 
> 
> Could any one kindly tell since which version is visibility attribute
> supported by gcc? So that I will be able to write some conditional
> macros definition code to make things more flexible? 
> 
> The macro definition is supposed to be something like:
> #if ((__GNUC__ *100 +__GNUC_MINOR__) >= 303)
> #define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
> #else
> #define G_GNUC_INTERNAL
> #endif
> 
Look at this wiki entry for checking visibility(a macros is already
there...):
http://gcc.gnu.org/wiki/Visibility

And by reading manual, you will find, that visibility attribute appeared
in 3.3 release (earlier compiler do not have this option documented in
manual)


Arturas M.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: help on fucntion visibility
  2006-12-06  8:51 ` Artūras Moskvinas
@ 2006-12-07  2:40   ` Irene (Shi Ying) Huang
  0 siblings, 0 replies; 3+ messages in thread
From: Irene (Shi Ying) Huang @ 2006-12-07  2:40 UTC (permalink / raw)
  To: Artūras Moskvinas; +Cc: gcc-help

Thanks Artūras

Is the macro you mention about HAVE_GCCVISIBILITYPATCH? If it is an
official macro, where can I find the documentation for it? 

Thanks again :) 

--Irene

On Wed, 2006-12-06 at 10:51 +0200, Artūras Moskvinas wrote:
> 
> > 
> > I know that the current version gcc supports function visibility
> > attributes, yet some of the previous versions does not. 
> > 
> > Could any one kindly tell since which version is visibility attribute
> > supported by gcc? So that I will be able to write some conditional
> > macros definition code to make things more flexible? 
> > 
> > The macro definition is supposed to be something like:
> > #if ((__GNUC__ *100 +__GNUC_MINOR__) >= 303)
> > #define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
> > #else
> > #define G_GNUC_INTERNAL
> > #endif
> > 
> Look at this wiki entry for checking visibility(a macros is already
> there...):
> http://gcc.gnu.org/wiki/Visibility
> 
> And by reading manual, you will find, that visibility attribute appeared
> in 3.3 release (earlier compiler do not have this option documented in
> manual)
> 
> 
> Arturas M.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-07  2:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-06  6:36 help on fucntion visibility Irene (Shi Ying) Huang
2006-12-06  8:51 ` Artūras Moskvinas
2006-12-07  2:40   ` Irene (Shi Ying) Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).