On Tue, Sep 14, 2010 at 3:30 AM, Brett Nash <n...@nash.id.au> wrote: > > > > #ifdef ELM_ETHUMB > > > EAPI Ethumb_Client *elm_thumb_ethumb_client_get(void); > > > #else > > > EAPI void *elm_thumb_ethumb_client_get(void); > > > #endif > > > > > > How are you supposed to use it in an application without an #ifdef? > > > Well I suppose you could declare your pointer as a void *, and go from > > > there, but then we kill the need for the #ifdef in Elm.h. > > > > > > Otherwise if you need an ifdef in the application anyway, why not just > > > get rid of the API call entirely when ifdefed out? > > > > > > What is even worse of course is the application needs an ifdef around > > > the type decleration _or_ always uses > > > a void pointer? > > > > > > Suggestions: > > > - change it to always return NULL > > > - change it to always return struct _Ethumb_Client * > > > (since opaque structures don't need to be declared? > > > > > > Regards, > > > nash > > > > > > > Hi > > > > You can compile elementary without EThumb library support, so in this > > case you maybe have not Ethumb.h present and Ethumb_Client is > > unknown. > > Yeah I got that bit. Please read my email again: Do you see the issue? > > To use this API in an application I need to either use an #ifdef thereby > defeating the purpose of the #ifdef/#else combo in elm.h > Or I need t to use only a void * as my type. > > The issue needs to be fixed. It's wrong. > > There is a small error in my 2 suggestions: the first should be: > - Change it to always return void *
this is a valid change, anyway your code using it likely should check for ethumb && elementary with ethumb and as you need the ifdef for the former, you do the same for the later. So you can do this, but from an usage POV it is basically the same thing/effort as you'll not be getting the value anyway. I dislike using struct instead. BR, -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel