#ifndef _COMMDEF_H_ #define _COMMDEF_H_ #if !defined(__solaris__) && defined(__sun__) #define __solaris__ #endif #ifdef _WIN32 #ifdef ARCLIB_EXPORTS #define ARCLIB_API #else #define ARCLIB_API #endif #ifndef NULL #define NULL 0 #endif #ifndef int8_t typedef signed char int8_t; #endif #ifndef u_int8_t typedef unsigned char u_int8_t; #endif #ifndef int16_t typedef signed short int16_t; #endif #ifndef u_int16_t typedef unsigned short u_int16_t; #endif #ifndef int32_t typedef signed int int32_t; #endif #ifndef u_int32_t typedef unsigned int u_int32_t; #endif #ifndef int64_t typedef long long int64_t; #endif #ifndef u_int64_t typedef unsigned long long u_int64_t; #endif #endif // end of _WIN32 #if defined(__linux__) || defined(__FreeBSD__) || defined(__sun__) || defined(__APPLE__) #define __unix_like__ 1 #include //Standard input/output definitions #include //String function definitions #include #include #include #include //waitpid() and wait() #ifdef __linux__ #include #endif #include #include #include #include // File control definitions #include // Error number definitions #include // POSIX terminal control definitions #include // fork() #include #include // inet_addr(...) #include #include #include #endif // end of defined(__linux__) || defined(__FreeBSD__) || defined(__sun__) || defined(__APPLE__) #ifdef __solaris__ typedef unsigned char u_int8_t; typedef unsigned short u_int16_t; typedef unsigned long u_int32_t; typedef unsigned long long u_int64_t; #endif #ifdef _DOS #include #include #include #include #include #include #include #include #include #ifndef int8_t typedef signed char int8_t; #endif #ifndef u_int8_t typedef unsigned char u_int8_t; #endif #ifndef int16_t typedef signed int int16_t; #endif #ifndef u_int16_t typedef unsigned int u_int16_t; #endif #ifndef int32_t typedef signed long int32_t; #endif #ifndef u_int32_t typedef unsigned long u_int32_t; #endif #endif // end of _DOS #ifndef _WIN32 #ifndef IN #define IN #endif #ifndef OUT #define OUT #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #ifndef BOOL #define BOOL int8_t #endif #ifndef CHAR #define CHAR int8_t #endif #ifndef UCHAR #define UCHAR u_int8_t #endif #ifndef BYTE #define BYTE u_int8_t #endif #ifndef PBYTE #define PBYTE u_int8_t * #endif #ifndef WORD #define WORD u_int16_t #endif #ifndef DWORD #define DWORD u_int32_t #endif #ifndef LONG #define LONG int32_t #endif #ifndef ULONG #define ULONG uint32_t #endif #ifndef LVOID #define LVOID void * #endif #ifndef LPVOID #define LPVOID void * #endif #ifndef HANDLE #define HANDLE int #endif #ifndef SOCKET #define SOCKET int #endif #ifndef SOCKET_ERROR #define SOCKET_ERROR -1 #endif #ifndef INVALID_SOCKET #define INVALID_SOCKET -1 #endif #endif // end of _WIN32 #endif //end of _COMMDEF_H_