Hi there,
On Mon, 26 Nov 2007, 22:32:41 +0100, Audet, Jean-Michel wrote:
> Hi,
>
> I am currently use the hb_api.h (heartbeat API) to add some
> node management in my application. My application is in C++ and I
> always get errors on compilation with reserved C++ word like new,
> delete, class, protected, private etc...
>
>
>
> I am not a C++ guru... I cannot find a way to make it works except
> changing the names of the variable in the declaration?
>
>
>
> Any success with C++?
I haven't actually played with the API files myself, but this is how I'd
use a C API file from C++:
#ifdef __cplusplus
extern "C" {
# define class __fake_class
# define delete __fake_delete
# define new __fake_new
// Add other defines for any conflicting C++ keyword
#endif
#include "hb_api.h"
#ifdef __cplusplus
}
#endif
This should make the stuff compilable, at least; if it still works, is
another question, though, but I have been successfull with such tricks
in the past.
> Thanks!
>
> Jean-Michel Audet
HTH, cheers.
l8er
manfred
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems