--- IO-AIO/schmorp.h 2014/04/11 05:19:41 1.16 +++ IO-AIO/schmorp.h 2019/09/06 13:51:16 1.20 @@ -57,10 +57,12 @@ typedef IV VAL64; # define SvVAL64(sv) SvIV (sv) # define newSVval64(i64) newSViv (i64) +# define sv_setval64(sv,i64) sv_setiv ((sv), (i64)) #else typedef NV VAL64; # define SvVAL64(sv) SvNV (sv) # define newSVval64(i64) newSVnv (i64) +# define sv_setval64(sv,i64) sv_setnv ((sv), (i64)) #endif /* typemap for the above */ @@ -306,7 +308,7 @@ closesocket (listener); -#ifdef USE_SOCKETS_AS_HANDLES +#if defined(USE_SOCKETS_AS_HANDLES) || PERL_VERSION_ATLEAST(5,18,0) /* when select isn't winsocket, we also expect socket, connect, accept etc. * to work on fds */ filedes [0] = sock [0]; @@ -359,19 +361,23 @@ #endif -#if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)) -# define SCHMORP_H_HAVE_EVENTFD 1 +#if HAVE_EVENTFD +# include +#else +# if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)) +# define SCHMORP_H_HAVE_EVENTFD 1 /* our minimum requirement is glibc 2.7 which has the stub, but not the header */ -# include -# ifdef __cplusplus +# include +# ifdef __cplusplus extern "C" { -# endif +# endif int eventfd (unsigned int initval, int flags); -# ifdef __cplusplus +# ifdef __cplusplus } +# endif +# else +# define eventfd(initval,flags) -1 # endif -#else -# define eventfd(initval,flags) -1 #endif typedef struct { @@ -438,11 +444,7 @@ DWORD dummy; WriteFile (S_TO_HANDLE (epp->fd [1]), (LPCVOID)&dummy, 1, &dummy, 0); #else -# if SCHMORP_H_HAVE_EVENTFD static uint64_t counter = 1; -# else - static char counter [8]; -# endif /* some modules accept fd's from outside, support eventfd here */ if (write (epp->fd [1], &counter, epp->len) < 0 && errno == EINVAL