Lots of #defines OK?

Ian Pilcher ian.pilcher at home.com
Thu Jul 19 11:36:44 CDT 2001


Patrik Stridvall wrote:

> 
> Not really, but as an alternative solution you could has a structure
> instead of an array like:
> 
> typedef struct {
>   GLYPHNAME A;
>   GLYPHNAME AE;
>   GLYPHNAME AEacute;
>   GLYPHNAME AEsmall;
>   /* ... */
> } GLYPHNAMES;
> 
> Perhaps this is better since it doesn't use the preprocessor.


I not thought of that -- neat idea.  What is the downside of using the
preprocessor, however?


> 
> However I'm not sure if all C compilers supports 1258 structure members.
> Another possible problem is alignment on some platforms if you must
> be able for iterate over it and use it as and array. Of course 
> you can simply have a seperate array of pointers like:
> 

I do need to iterate through it at one point.  In fact I iterate through
the array of names to create just such an array of pointers.  The array
may grow, however, so it has to be created dynamically.  (I suppose I
could start with a predefined array, copy it to the heap, and grow it
there, but that seems inelegant and wasteful somehow.)

Thanks for your feedback!
-- 
========================================================================
Ian Pilcher                                         ian.pilcher at home.com
========================================================================





More information about the wine-devel mailing list