[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: control of symbols exported by shared libraries
From: |
Bruno Haible |
Subject: |
Re: control of symbols exported by shared libraries |
Date: |
Wed, 27 Jul 2005 16:46:14 +0200 |
User-agent: |
KMail/1.5 |
Simon Josefsson wrote:
> I mean, the symbols
> that are not intended to be exported should all be marked with "static"
> anyway.
That's hardly possible in practice. The larger a library is, the larger is
the ratio of internal versus exported symbols. If you want all internal
symbols to be marked "static", it means in practice that you have at most
one or two compilation units.
I do the following in libasprintf in order to mark as many functions "static"
as possible:
#define STATIC static
/* Define auxiliary functions declared in "printf-args.h". */
#include "printf-args.c"
/* Define auxiliary functions declared in "printf-parse.h". */
#include "printf-parse.c"
/* Define functions declared in "vasnprintf.h". */
#include "vasnprintf.c"
#include "asnprintf.c"
/* Define functions declared in "vasprintf.h". */
#include "vasprintf.c"
#include "asprintf.c"
It's not pretty.
Bruno