Hi Gustavo,
I'd have to agree with you on how the includes should be done, the only
issue I see is that there are some things that you just can't do that way.
Without actually testing, I can't guarantee it will "just work", but from
what I remember, we had to include Escape.h in some places because of some
missing defines.
In the case of the ps3, there is a unistd.h file but it doesn't have
everything, that's why we have escape_unistd.h. The #include_next trick
that Lucas suggested could fix that and it's a great idea.
Looking at Escape.h, what I see though is that there's a define for some of
the CLOCK_* macros, the _UNUSED_ macro and the EAPI macro. I'm guessing the
_UNUSED_ and EAPI are not defined maybe because the configure takes care of
that in the config.h and it doesn't recognize the system in order to
determine how it should be set, that's why I had to add them in Escape.h.
As for the CLOCK_* defines, I guess they could go in their own .h and
another #include_next would do the trick in this case. The problem remains
that you still need to have a Escape.h file in order to do the
#include_next call.. and honestly, I don't see how a diff of :
-#include "escape_unistd.h"
+#include_next "unistd.h"
would make any real difference in the end...

There are however some things that might need to react differently whether
or not the platform supports it. For example, on the ps3, there is no
multiprocess support, so execv, signals, and all that don't exist. It makes
more sense to have #ifdefs in the EFL to handle such a case rather than
assume it works and do things as if it was working, and have the
compatibility layer just return errors or something. I know this
multi-process thing is an extreme case and it's probably best not to have
special code for it in the EFL (and I'd agree), but it's just the example
that I have off the top of my head. There might be other cases where it's
best to handle them differently rather than try to work around it.
Just my 2c.

KaKaRoTo

On Thu, Jan 3, 2013 at 1:40 PM, Lucas De Marchi <
[email protected]> wrote:

> On Thu, Jan 3, 2013 at 12:34 PM, Gustavo Sverzut Barbieri
> <[email protected]> wrote:
> > Hi people,
> >
> > I'm reviewing the checks in efl/configure.ac and some are quite weird,
> > which I want to remove if there is no valid reason for their existence.
> >
> > IMO the way Evil, Escape and Exotic are done are a bit cumbersome for the
> > libraries to use. For instance, evil_libgen.h matches libgen.h, however
> the
> > user code must have the following:
> >
> >    #ifdef HAVE_LIBGEN_H
> >    #include <libgen.h>
> >    #endif
> >    ...
> >    #ifdef HAVE_EVIL
> >    #include <Evil.h> /* includes evil_libgen.h */
> >    #endif
> >
> > why not call evil_libgen.h just libgen.h and let the user include it
> > normally? We just -I$(top_srcdir)/src/lib/evil if building for Evil, then
> > it makes life simpler.
> >
> > In my mind Evil.h and Exotic. doesn't even need to exist... they could
> > exist in some cases where the system file exists but lacks something.
> >     Say libgen.h in PS3 lacked basename, then we could have:
> >          * escape_libgen.h: basename() definition
> >          * Escape.h: includes escape_libgen.h to match complete libgen.h
>
> or.... you use "#include_next <libgen.h>"  inside Escape's libgen.h
> and don't bother with never ever creating Escape.h
>
> http://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html
>
>
> Not sure if other compilers support this, though
>
> Lucas De Marchi
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to