#ifndef __INC_LIBTHECORE_STDAFX_H__ #define __INC_LIBTHECORE_STDAFX_H__ #if defined(__GNUC__) #define INLINE __inline__ #elif defined(_MSC_VER) #define INLINE inline #endif #ifdef __WIN32__ #define WIN32_LEAN_AND_MEAN #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xdirent.h" #include "xgetopt.h" #define S_ISDIR(m) (m & _S_IFDIR) #define snprintf _snprintf struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; #define __USE_SELECT__ #define PATH_MAX _MAX_PATH // C runtime library adjustments #define strlcat(dst, src, size) strcat_s(dst, size, src) #define strlcpy(dst, src, size) strncpy_s(dst, size, src, _TRUNCATE) #define strtoull(str, endptr, base) _strtoui64(str, endptr, base) #define strtof(str, endptr) (float)strtod(str, endptr) #define strcasecmp(s1, s2) stricmp(s1, s2) #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n) #define atoll(str) _atoi64(str) #define localtime_r(timet, result) localtime_s(result, timet) #define strtok_r(s, delim, ptrptr) strtok_s(s, delim, ptrptr) #include #define typeof(t) BOOST_TYPEOF(t) // dummy declaration of non-supported signals #define SIGUSR1 30 /* user defined signal 1 */ #define SIGUSR2 31 /* user defined signal 2 */ inline void usleep(unsigned long usec) { ::Sleep(usec / 1000); } inline unsigned sleep(unsigned sec) { ::Sleep(sec * 1000); return 0; } inline double rint(double x) { return ::floor(x+.5); } #else #ifndef __FreeBSD__ #define __USE_SELECT__ #ifdef __CYGWIN__ #define _POSIX_SOURCE 1 #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __FreeBSD__ #include #endif #endif #ifndef false #define false 0 #define true (!false) #endif #ifndef FALSE #define FALSE false #define TRUE (!FALSE) #endif #include "typedef.h" #include "heart.h" #include "fdwatch.h" #include "socket.h" #include "kstbl.h" #include "hangul.h" #include "buffer.h" #include "signal.h" #include "log.h" #include "main.h" #include "utils.h" #include "crypt.h" #include "memcpy.h" #endif // __INC_LIBTHECORE_STDAFX_H__