On Tue, 17 Jun 2008 15:45:07 -0700
nsf <[EMAIL PROTECTED]> wrote:

> Hi.
> 
> I want to suggest few possible improvements that developers can do in
> libev.
> 
> 1) Include pkg-config .pc file to source distribution.
> 2) I wanted to compile my project (which is using libev) with -Wall and
> without any warnings, but there is few bad macros in libev.h. So, I was
> forced to remove all these macros and change them to ugly code.
> You can see in this commit what I mean:
> http://github.com/nsf/bmpanel/commit/60f74645be5e234f778d43621cbfc59d9f9d6cd8
> (just search with browser string "ev_io_init" and look around)
> 
> I'm not a pro in C, but why are you using these type conversions in
> macros:
> 
> -----------------------------------------------
> #define ev_init(ev,cb_) do {                  \
>   ((ev_watcher *)(void *)(ev))->active   =    \
>   ((ev_watcher *)(void *)(ev))->pending  =    \
>   ((ev_watcher *)(void *)(ev))->priority = 0; \
>   ev_set_cb ((ev), cb_);                      \
> } while (0)
> -----------------------------------------------
> 
> and
> 
> -----------------------------------------------
> #define ev_timer_set(ev,after_,repeat_)     do { ((ev_watcher_time 
> *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0)
> -----------------------------------------------
> 
> They will work without them. And also there will be no warnings in -Wall
> mode.
> 
> I'm using gcc 4.3.0.
> 
> Thank you for your attention. :)

Here is the patch for libev-3.42 which adds pkg-config support. Well,
if you need it.
diff -Naur libev-3.42/Makefile.am libev-3.42-patched/Makefile.am
--- libev-3.42/Makefile.am	2008-05-10 17:12:36.000000000 -0700
+++ libev-3.42-patched/Makefile.am	2008-06-17 17:06:40.000000000 -0700
@@ -16,3 +16,5 @@
 libev_la_SOURCES = ev.c event.c
 libev_la_LDFLAGS = -version-info $(VERSION_INFO)
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libev.pc
diff -Naur libev-3.42/configure.ac libev-3.42-patched/configure.ac
--- libev-3.42/configure.ac	2008-06-17 03:12:02.000000000 -0700
+++ libev-3.42-patched/configure.ac	2008-06-17 17:07:41.000000000 -0700
@@ -1,4 +1,4 @@
-AC_INIT
+AC_INIT(libev,3.42)
 AC_CONFIG_SRCDIR([ev_epoll.c])
 
 AM_INIT_AUTOMAKE(libev,3.42)
@@ -14,5 +14,5 @@
 
 m4_include([libev.m4])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile libev.pc])
 AC_OUTPUT
diff -Naur libev-3.42/libev.pc.in libev-3.42-patched/libev.pc.in
--- libev-3.42/libev.pc.in	1969-12-31 16:00:00.000000000 -0800
+++ libev-3.42-patched/libev.pc.in	2008-06-17 17:05:33.000000000 -0700
@@ -0,0 +1,11 @@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+
+Name: libev
+Description: A full-featured and high-performance event loop
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lev
+Libs.private: @LIBS@
+Cflags: -I${includedir}
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to