Re: Question on using C++ API

2015-11-18 Thread Marc Lehmann
On Wed, Nov 18, 2015 at 05:38:15PM +0100, Thorsten Lück wrote: > void operator() (EV_P_ ev_io &w, int revents) the documented syntax for operator () would be this, taken straight from the example for the set (object *) method: void operator() (ev::io &w, int revents) --

Re: Question on using C++ API

2015-11-18 Thread Alexander Klauer
Hi Thorsten, On 11/18/2015 05:38 PM, Thorsten Lück wrote: struct udp_client { void operator() (EV_P_ ev_io &w, int revents) { } }; Does anybody has an idea what I am doing wrong? have you tried without the loop (EV_P_) in the signature? Take care, Alexander -- Dr. Alexander K

Question on using C++ API

2015-11-18 Thread Thorsten Lück
Hi @all, I want to write a small embedded application listing on UDP. It is compiling using the C-Api but not using the C++-Api. In both cases I am using the gnu g++ compiler: > $ /opt/crosstool-ng-powerpc/bin/powerpc-e500v2-linux-gnuspe-g++ --version > powerpc-e500v2-linux-gnuspe-g++ (cro

Re: C++ API

2012-05-04 Thread fatmck
于 2012年05月03日 21:27, Marc Lehmann 写道: On Thu, May 03, 2012 at 08:45:30AM +0800, 马承珂 wrote: Did you use the "-Wall" option? I just write a very easy sample code to test this on Ubuntu12.04 with g++4.6.3. You said you get it with -O2, and I disagreed, which apparently turned out to be true. -Wa

Re: Re: Re: C++ API

2012-05-04 Thread Marc Lehmann
On Thu, May 03, 2012 at 08:45:30AM +0800, 马承珂 wrote: > Did you use the "-Wall" option? I just write a very easy sample code to test > this on Ubuntu12.04 with g++4.6.3. You said you get it with -O2, and I disagreed, which apparently turned out to be true. -Wall != -O2. -- The c

Re:Re: Re: C++ API

2012-05-04 Thread 马承珂
Did you use the "-Wall" option? I just write a very easy sample code to test this on Ubuntu12.04 with g++4.6.3. ev_o2.cpp: #include "ev.h" ev_io myev; void on_read(struct ev_loop *loop, ev_io *watcher, int events) { } int main() { ev_io_init(&myev, on_read, 0, EV_READ); return 0; } then u

Re: Re: C++ API

2012-04-19 Thread Marc Lehmann
On Thu, Apr 19, 2012 at 10:11:17PM +0800, 马承珂 wrote: > At 2012-04-19 15:35:46,"Marc Lehmann" wrote: > >As an additional info-let: current versions of gcc (at least 4.4+) don't > >emit any warnings when compiled with -O2, except in the CVS version, and > >there is a bug open in gcc for that one, a

Re:Re: C++ API

2012-04-19 Thread 马承珂
At 2012-04-19 15:35:46,"Marc Lehmann" wrote: >As an additional info-let: current versions of gcc (at least 4.4+) don't >emit any warnings when compiled with -O2, except in the CVS version, and >there is a bug open in gcc for that one, as it shouldn't warn. Sorry, I mean g++ when saying gcc, I am

Re: C++ API

2012-04-19 Thread Marc Lehmann
On Thu, Apr 19, 2012 at 08:37:53AM +0800, Echo wrote: > i am using libev c API in c++ on Linux both 32 and 64 bit, it works great for > two years. There are a few compiler warnings when using gcc with O2 option, > just ignore them, it doesn't matter. As an additional info-let: cu

Re: C++ API

2012-04-19 Thread Marc Lehmann
On Wed, Apr 18, 2012 at 11:02:35AM -0400, Kevyn-Alexandre Paré wrote: > On 2012-04-18, at 1:33 AM, Marc Lehmann wrote: > > > On Tue, Apr 17, 2012 at 04:18:13PM -0400, Kevyn-Alexandre Paré > > wrote: > >> I'm new to libev and want to know if the C++ API

Re: C++ API

2012-04-18 Thread Echo
i am using libev c API in c++ on Linux both 32 and 64 bit, it works great for two years. There are a few compiler warnings when using gcc with O2 option, just ignore them, it doesn't matter. 发自我的 iPhone 在 2012-4-18,23:02,Kevyn-Alexandre Paré 写道: > Hi Marc, > > Thx for havin

Re: C++ API

2012-04-18 Thread Kevyn-Alexandre Paré
Hi Marc, Thx for having made & share such library! On 2012-04-18, at 1:33 AM, Marc Lehmann wrote: > On Tue, Apr 17, 2012 at 04:18:13PM -0400, Kevyn-Alexandre Paré > wrote: >> I'm new to libev and want to know if the C++ API is equivalent to the C API? > > For wh

Re: C++ API

2012-04-17 Thread Marc Lehmann
On Tue, Apr 17, 2012 at 04:18:13PM -0400, Kevyn-Alexandre Paré wrote: > I'm new to libev and want to know if the C++ API is equivalent to the C API? For what definition of equivalent? > That made me wonder what was the latest update on what was supported and not > supported wi

C++ API

2012-04-17 Thread Kevyn-Alexandre Paré
Hi, I'm new to libev and want to know if the C++ API is equivalent to the C API? I have seen in the mailing list some discussion between Marc & Leandro saying OLD stuff : http://lists.schmorp.de/pipermail/libev/2008q4/000450.html That made me wonder what was the latest update on

c++ api for libeio

2008-06-03 Thread Marc Lehmann
As I said, I probably won't do it, but here is a wrapper that converts the callback/data combination into a object */method * combo: This class can be used for all wrapper functions (but only for non-const objects, due to the horribly useless const semantics in C++, you need a separate set of wrap