--- libev/ev.c 2010/10/21 12:32:47 1.353 +++ libev/ev.c 2010/10/22 09:24:11 1.354 @@ -37,10 +37,6 @@ * either the BSD or the GPL. */ -#ifdef __cplusplus -extern "C" { -#endif - /* this big block deduces configuration from config.h */ #ifndef EV_STANDALONE # ifdef EV_CONFIG_H @@ -184,6 +180,8 @@ # include "ev.h" #endif +EV_CPP(extern "C" {) + #ifndef _WIN32 # include # include @@ -413,13 +411,7 @@ # define EFD_CLOEXEC 02000000 # endif # endif -# ifdef __cplusplus -extern "C" { -# endif -int (eventfd) (unsigned int initval, int flags); -# ifdef __cplusplus -} -# endif +EV_CPP(extern "C") int (eventfd) (unsigned int initval, int flags); #endif #if EV_USE_SIGNALFD @@ -435,19 +427,13 @@ # define SFD_CLOEXEC 02000000 # endif # endif -# ifdef __cplusplus -extern "C" { -# endif -int signalfd (int fd, const sigset_t *mask, int flags); +EV_CPP (extern "C") int signalfd (int fd, const sigset_t *mask, int flags); struct signalfd_siginfo { uint32_t ssi_signo; char pad[128 - sizeof (uint32_t)]; }; -# ifdef __cplusplus -} -# endif #endif /**/ @@ -3809,7 +3795,5 @@ #include "ev_wrap.h" #endif -#ifdef __cplusplus -} -#endif +EV_CPP(})