/***************************************************************************** $Id$ File: project.h Date: 06Apr06 Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. Gmail: blackhedd This program is free software; you can redistribute it and/or modify it under the terms of either: 1) the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version; or 2) Ruby's License. See the file COPYING for complete licensing information. *****************************************************************************/ #ifndef __Project__H_ #define __Project__H_ #ifdef OS_WIN32 #pragma warning(disable:4786) #endif #include #include #include #include #include #include #include #include #ifdef OS_UNIX #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef int SOCKET; #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #ifdef OS_SOLARIS8 #include #include #ifndef AF_LOCAL #define AF_LOCAL AF_UNIX #endif // INADDR_NONE is undefined on Solaris < 8. Thanks to Brett Eisenberg and Tim Pease. #ifndef INADDR_NONE #define INADDR_NONE ((unsigned long)-1) #endif #endif /* OS_SOLARIS8 */ #ifdef _AIX #include #ifndef AF_LOCAL #define AF_LOCAL AF_UNIX #endif #endif /* _AIX */ #endif /* OS_UNIX */ #ifdef OS_WIN32 // 21Sep09: windows limits select() to 64 sockets by default, we increase it to 1024 here (before including winsock2.h) // 18Jun12: fd_setsize must be changed in the ruby binary (not in this extension). redefining it also causes segvs, see eventmachine/eventmachine#333 //#define FD_SETSIZE 1024 #define WIN32_LEAN_AND_MEAN #include #include #include #include #include #include #define close closesocket typedef int socklen_t; #ifndef _PID_T_ #define _PID_T_ typedef int pid_t; #endif /* _PID_T_ */ #endif /* OS_WIN32 */ #if !defined(_MSC_VER) || _MSC_VER > 1500 #include #endif using namespace std; #ifdef WITH_SSL #include #include #endif #ifdef HAVE_EPOLL #include #endif #ifdef HAVE_KQUEUE #include #include #endif #ifdef HAVE_INOTIFY #include #endif #ifdef HAVE_OLD_INOTIFY #include #include static inline int inotify_init (void) { return syscall (__NR_inotify_init); } static inline int inotify_add_watch (int fd, const char *name, __u32 mask) { return syscall (__NR_inotify_add_watch, fd, name, mask); } static inline int inotify_rm_watch (int fd, __u32 wd) { return syscall (__NR_inotify_rm_watch, fd, wd); } #define HAVE_INOTIFY 1 #endif #ifdef HAVE_INOTIFY #define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event)) #endif #ifdef HAVE_WRITEV #include #endif #if __cplusplus extern "C" { #endif typedef void (*EMCallback)(const unsigned long, int, const char*, const unsigned long); #if __cplusplus } #endif #include "binder.h" #include "em.h" #include "ed.h" #include "page.h" #include "ssl.h" #include "eventmachine.h" #endif // __Project__H_