On Wed, 26 Oct 2011 10:55:58 +0200 (CEST) Vincent Torri <[email protected]>
said:

> 
> Hey
> 
> Eina includes eina_inline_lock_posix.h on something else than Windows, 
> hence pthread.h. _GNU_SOURCE is not defined.
> 
> Suppose now that a user of Eina does this:
> 
> #include <Eina.h>
> #include <pthread.h>
> 
> The user will not have the possibility to features available with 
> _GNU_SOURCE (like CPU_SET for example. I have that problem with Enesim), 
> except by defining it just before including Eina.h. Which is not the best 
> solution, I think.
> 
> The problem, here, is that lock stuff is only inlined functions. The 
> problem will be solved if they are in a source file. Maybe at the 
> beginning, having these functions inlined was interesting because they 
> were short. I'm not sure that keeping them inlined is really useful, now.
> 
> Another solution would be to define _GNU_SOURCE before including pthread.h 
> (maybe under some conditions). But is it a good solution too ?
> 
> Honestly, I don't know what the best solution is. So if someone knows how 
> to properly fix that problem...
> 
> Vincent

i agree with you - putting actual functions inside headers as macros or inlines
has big problems when those functions:

1. can be big (that means maybe more than 10 lines of code) - this causes code
bloat as the function is duplicated in the app every time its used
2. if the function must serve as a compatibility system - eg change behavior
based on compiletime setup and maybe change from install to install of the
library (feature is there or is not). once app is compiled, then what the
function does can never change regardless of whatever we change in eina, so
doing macors and inlines is best limited to cases where the content will NEVER
change AND where performance is so absolutely necessary that we must make them
inlined.


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [email protected]


------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to