set some define consistency

This patch cleanup the defines to make then consistent.
This commit is contained in:
David Fort 2018-02-04 23:16:12 +01:00
parent a90be56099
commit 917bc4b551
7 changed files with 26 additions and 26 deletions

View File

@ -592,12 +592,12 @@ else()
endif()
if(UNIX OR CYGWIN)
check_include_files(sys/eventfd.h HAVE_AIO_H)
check_include_files(sys/eventfd.h HAVE_EVENTFD_H)
if (HAVE_EVENTFD_H)
check_include_files(aio.h HAVE_AIO_H)
check_include_files(sys/eventfd.h HAVE_SYS_EVENTFD_H)
if (HAVE_SYS_EVENTFD_H)
check_symbol_exists(eventfd_read sys/eventfd.h WITH_EVENTFD_READ_WRITE)
endif()
check_include_files(sys/timerfd.h HAVE_TIMERFD_H)
check_include_files(sys/timerfd.h HAVE_SYS_TIMERFD_H)
check_include_files(poll.h HAVE_POLL_H)
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
check_symbol_exists(ceill math.h HAVE_MATH_C99_LONG_DOUBLE)

View File

@ -14,8 +14,8 @@
#cmakedefine HAVE_SYS_SELECT_H
#cmakedefine HAVE_SYS_SOCKIO_H
#cmakedefine HAVE_SYS_STRTIO_H
#cmakedefine HAVE_EVENTFD_H
#cmakedefine HAVE_TIMERFD_H
#cmakedefine HAVE_SYS_EVENTFD_H
#cmakedefine HAVE_SYS_TIMERFD_H
#cmakedefine HAVE_TM_GMTOFF
#cmakedefine HAVE_AIO_H
#cmakedefine HAVE_POLL_H

View File

@ -45,11 +45,11 @@
#include <assert.h>
#include <unistd.h>
#ifdef HAVE_AIO_H
#undef HAVE_AIO_H /* disable for now, incomplete */
#ifdef HAVE_SYS_AIO_H
#undef HAVE_SYS_AIO_H /* disable for now, incomplete */
#endif
#ifdef HAVE_AIO_H
#ifdef HAVE_SYS_AIO_H
#include <aio.h>
#endif
@ -327,7 +327,7 @@ BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
return FALSE;
pipe->lpOverlapped = lpOverlapped;
#ifdef HAVE_AIO_H
#ifdef HAVE_SYS_AIO_H
{
int aio_status;
struct aiocb cb;
@ -416,7 +416,7 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
return FALSE;
pipe->lpOverlapped = lpOverlapped;
#ifdef HAVE_AIO_H
#ifdef HAVE_SYS_AIO_H
{
struct aiocb cb;
ZeroMemory(&cb, sizeof(struct aiocb));

View File

@ -37,7 +37,7 @@
#include <unistd.h>
#endif
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
#include <sys/eventfd.h>
#endif
@ -126,7 +126,7 @@ HANDLE CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
event->pipe_fd[0] = -1;
event->pipe_fd[1] = -1;
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
event->pipe_fd[0] = eventfd(0, EFD_NONBLOCK);
if (event->pipe_fd[0] < 0)
@ -176,7 +176,7 @@ HANDLE OpenEventA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
return NULL;
}
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
#if !defined(WITH_EVENTFD_READ_WRITE)
static int eventfd_read(int fd, eventfd_t* value)
{
@ -202,7 +202,7 @@ BOOL SetEvent(HANDLE hEvent)
if (winpr_Handle_GetInfo(hEvent, &Type, &Object))
{
event = (WINPR_EVENT*) Object;
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
eventfd_t val = 1;
do
@ -249,7 +249,7 @@ BOOL ResetEvent(HANDLE hEvent)
{
do
{
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
eventfd_t value;
length = eventfd_read(event->pipe_fd[0], &value);
#else

View File

@ -79,7 +79,7 @@ struct winpr_event
};
typedef struct winpr_event WINPR_EVENT;
#ifdef HAVE_TIMERFD_H
#ifdef HAVE_SYS_TIMERFD_H
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

View File

@ -109,7 +109,7 @@ BOOL TimerCloseHandle(HANDLE handle)
if (!timer->lpArgToCompletionRoutine)
{
#ifdef HAVE_TIMERFD_H
#ifdef HAVE_SYS_TIMERFD_H
if (timer->fd != -1)
close(timer->fd);
@ -179,7 +179,7 @@ int InitializeWaitableTimer(WINPR_TIMER* timer)
if (!timer->lpArgToCompletionRoutine)
{
#ifdef HAVE_TIMERFD_H
#ifdef HAVE_SYS_TIMERFD_H
int status;
timer->fd = timerfd_create(CLOCK_MONOTONIC, 0);
@ -293,9 +293,9 @@ BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPerio
#ifdef WITH_POSIX_TIMER
LONGLONG seconds = 0;
LONGLONG nanoseconds = 0;
#ifdef HAVE_TIMERFD_H
#ifdef HAVE_SYS_TIMERFD_H
int status = 0;
#endif /* HAVE_TIMERFD_H */
#endif /* HAVE_SYS_TIMERFD_H */
#endif /* WITH_POSIX_TIMER */
if (!winpr_Handle_GetInfo(hTimer, &Type, &Object))
@ -360,7 +360,7 @@ BOOL SetWaitableTimer(HANDLE hTimer, const LARGE_INTEGER* lpDueTime, LONG lPerio
if (!timer->pfnCompletionRoutine)
{
#ifdef HAVE_TIMERFD_H
#ifdef HAVE_SYS_TIMERFD_H
status = timerfd_settime(timer->fd, 0, &(timer->timeout), NULL);
if (status)

View File

@ -77,7 +77,7 @@
#include <unistd.h>
#endif
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
#include <sys/eventfd.h>
#endif
@ -215,7 +215,7 @@ static BOOL set_event(WINPR_THREAD* thread)
{
int length;
BOOL status = FALSE;
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
eventfd_t val = 1;
do
@ -247,7 +247,7 @@ static BOOL reset_event(WINPR_THREAD* thread)
{
int length;
BOOL status = FALSE;
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
eventfd_t value;
do
@ -399,7 +399,7 @@ HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes,
#endif
thread->pipe_fd[0] = -1;
thread->pipe_fd[1] = -1;
#ifdef HAVE_EVENTFD_H
#ifdef HAVE_SYS_EVENTFD_H
thread->pipe_fd[0] = eventfd(0, EFD_NONBLOCK);
if (thread->pipe_fd[0] < 0)