libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] visibility


From: LRN
Subject: Re: [libmicrohttpd] visibility
Date: Sun, 26 Jan 2014 06:17:23 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Thunderbird/29.0a1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25.01.2014 11:57, LRN wrote:
> On 25.01.2014 4:39, LRN wrote:
>> Recently MHD added visibility attributes to hide some functions.
> 
>> This throws lots of warnings on W32, since visibility attributes 
>> are not supported here.
> 
>> I knew for a fact that GTK does have visibility, and doesn't have
>>  visibility problems on W32, so i checked how the do this. Turns 
>> out, the compile with -fvisibility=hidden (which doesn't throw
>> any warnings on W32, it's ignored), and mark _visible_ functions
>> with "attribute visibility default" AND (on W32) __dllexport.
>> Obviously, this is when compiling GTK. For GTK users the macro
>> that puts these on functions expands to a simple "extern".
> 
>> I'll try to implement this for MHD and see how it goes.
> 
> 
> Implemented. Compiles here for me, no warnings. Will test it on my 
> Debian machine later on.
> 
> 

Done. See the attached patch. What it does:

Add decl check for _stati64 (required for newer plibc)

Remove redundant -no-undefined (it's part of mandatory MHD_LIB_LDFLAGS
now)

Remove --export-all-symbols for W32 (visibility is used instead)
Add -fvisibility=hidden configure check (shamelessly borrowed from GTK)

Remove unused -export-symbols-regex check

Define _MHD_EXTERN to "extern" if it's undefined (this is what clients
get)

Mark all public functions with _MHD_EXTERN

Remove HIDDEN_SYMBOL definition

Don't mark hidden functions with HIDDEN_SYMBOL (everything that is not
explicitly public is hidden by default now)

Change constructor macros a bit to apply _MHD_EXTERN to them cleanly

Use HIDDEN_VISIBILITY_CFLAGS when compiling libraries

Remove EXPORT.sym files, don't mention them in EXTRA_DIST, don't use
them to define a list of exported functions

- -- 
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJS5HAyAAoJEOs4Jb6SI2Cw2RgH/jQ1gKBZhXrpCT0uYOMN5HsP
dOu00I9d/C18rwxDm/ruSk5WlhGKoL47QqinTXdicAeEywha+YVDq1fR6jcHK6EY
OPDMUQLlReN5wxcmTzS+qPAcb5LtskZPEHuea0n77QCp/g95h1GU036VWprqFiq5
4Eqrljmw1bfGsl5KXNl2jE4nvEOze/J5uXzdNUORQ7STm876plhjLGiQQ1gbJl4e
QOtLfq029rZoVAC21pE4yF7TgrqbC4y3IDHoUgfNqv4XdJnmm1R/F9106S51H1EQ
huROHWRSPx/VMdh9N2kbfHOXT4066p2is53XyRdUra5QQTx9JAjj4DFQ5Kqk9dI=
=CGyQ
-----END PGP SIGNATURE-----

Attachment: visibility.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]