Dear Jonathan,

Many thanks for this. Where should I go next, to have this fixed in the current debian version?

regards,

Kojedzinszky Richard

On Sun, 17 Apr 2011, Jonathan Neuschäfer wrote:

On Fri, Apr 15, 2011 at 10:12:20AM +0200, Richard Kojedzinszky wrote:
Dear ev developers,

I am suggesting the attached patch to be applied, as the following
short code does not compile:

--- code
#include <ev++.h>
#include <iostream>

class A {
        public:
                void cb(int x) {
                        std::cerr << "A::cb()" << std::endl;
                }
};

int main()
{
        ev::dynamic_loop l;
        A a;

        l.once<A, &A::cb>(-1, 0, 0, &a);

        l.loop();

        return 0;
}
--- code

I can reproduce that with gcc 4.5.2-8 (from Debian), and that your patch
(minus the last hunk, see below) makes it compile.


I am using the version included in debian squeeze:
$ dpkg -l|grep -i libev-dev
ii  libev-dev                          1:3.9-1
static library, header files, and docs for libev

Regards,
Kojedzinszky Richard

[...]
@@ -480,7 +480,7 @@
     template<class K, void (K::*method)()>
     static void method_noargs_thunk (EV_P_ ev_watcher *w, int revents)
     {
-      static_cast<K *>(w->data)->*method
+      (static_cast<K *>(w->data)->*method)
         ();
     }


This last hunk has already been applied in the current CVS (patch below).

Jonathan

---
commit b8cdc9e71ad1753d9a020ad413d28ba1dd69c9e4
Author: root <root>
Date:   Thu Jun 24 19:22:26 2010 +0000

   *** empty log message ***

diff --git a/Changes b/Changes
index 2c7e50f..8fa192e 100644
--- a/Changes
+++ b/Changes
@@ -4,6 +4,10 @@ TODO: ABI??? API????? Changes???
TODO: win32 write() to socket for signal handling
TODO: poll asert
TODO: EV_USE__XXX default with config, document
+TODO: pendingall => idleall?
+TODO: portbality section, solaris errno rrentrant, aix, win32, linux 32 bit
+TODO: include ev_xyz_start in each example?
+TODO: section watcher states/lifetime
        - "PORTING FROM LIBEV 3.X TO 4.X" (in ev.pod) is recommended reading.
        - ev_embed_stop did not correctly stop the watcher (very good
          testcase by Vladimir Timofeev).
@@ -35,6 +39,7 @@ TODO: EV_USE__XXX default with config, document
        - rename EV_TIMEOUT to EV_TIMER.
        - rename ev_loop_count/depth/verify.
        - switch to two-digit minor version.
+        - work around an apparent gentoo compiler bug.

3.9  Thu Dec 31 07:59:59 CET 2009
        - signalfd is no longer used by default and has to be requested
diff --git a/ev++.h b/ev++.h
index e8c079f..315ee65 100644
--- a/ev++.h
+++ b/ev++.h
@@ -480,7 +480,7 @@ namespace ev {
    template<class K, void (K::*method)()>
    static void method_noargs_thunk (EV_P_ ev_watcher *w, int revents)
    {
-      static_cast<K *>(w->data)->*method
+      (static_cast<K *>(w->data)->*method)
        ();
    }

diff --git a/ev.pod b/ev.pod
index eb12a3f..e760656 100644
--- a/ev.pod
+++ b/ev.pod
@@ -194,7 +194,7 @@ compatible to older versions, so a larger minor version 
alone is usually
not a problem.

Example: Make sure we haven't accidentally been linked against the wrong
-version.
+version (note, however, that this will not detect ABI mismatches :).

   assert (("libev version mismatch",
            ev_version_major () == EV_VERSION_MAJOR
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to