[cairo] Reducing .data

Behdad Esfahbod behdad at behdad.org
Mon Dec 18 08:12:14 PST 2006

On Mon, 2006-12-18 at 09:42 +0100, Jean-Baptiste Note wrote:
> Hello,
> I guess you may already be aware of this, but...
> A slightly more beautiful way (to my untrained eye) to do this is
> explained in the DSO howto by Ulrich Drepper. See appendix B,
> "Automatic handling of Arrays of String Pointers" in
> http://people.redhat.com/drepper/dsohowto.pdf

Yes, I know, and I've been a great fan of it until recently.  When it
came down to using it, I figured I really prefer to keep everything in
the same file.  At least in cairo.


> You can slightly alter the logic to have a DSO and non-DSO version of
> the code (for instance, for static libraries). The macros can even be
> made a bit more generic so that you can do something like:
> #define ARRAY_FILE "stringtab.h"
> #define LOOKUP_NAME stringarrayname
> #include "stringlookup.h"
> And reuse the stinglookup file for every string array in the code.
> JB

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list