On Mon, Dec 22, 2008 at 10:44:35PM -0800, Sean Hefty wrote:

> >If we will add "extern" keyword for exported symbols and somewhere in
> >windows-specific header file it will be redefined as
> >
> >#define extern __declspec(dllexport)
> 
> I don't think we want to get into redefining keywords.

Right, that's evil..

Anyhow, on linux it is considered a best practice for library authors
to do the same as what the above option does on windows - explicitly
mark symbols as exported. This prevents symbol table pollution.

To do this you use the -fvisibility=hidden flag and mark exported
symbols with __attribute__((visibility("default"))). Everything else
will not be available for dynamic linking.

> >> +MAD_EXPORT uint32_t mad_get_field(void *buf, int base_offs, int field);
> >> +MAD_EXPORT void mad_set_field(void *buf, int base_offs, int field, 
> >> uint32_t
> >val);
> >
> >Windows don't like "inline"?
> 
> The compiler doesn't allow it in the header file.

Not even static inline? Inline functions in header should all be
static inline or extern inline to avoid comdefs..

Jason
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to