1 /* overall.h - TransparentIRC 0.1
2 * Copyright (C) 2011-2012 Philipp Kreil (pk910)
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "../config.h"
22 #define TRANSIRC_VERSION "0.1"
23 #define VERSION_PATCHLEVEL 0
25 #define IO_READ_BUFLEN 1024
26 #define IO_MAX_TIMEOUT 10
39 #include <sys/types.h>
40 #include <sys/socket.h>
41 #include <netinet/in.h>
42 #include <netinet/tcp.h>
43 #include <arpa/inet.h>
56 #define PRINTF_LIKE(M,N) __attribute__((format (printf, M, N)))
58 #define PRINTF_LIKE(M,N)
62 #define UNUSED_ARG(ARG) ARG __attribute__((unused))
63 #elif defined(S_SPLINT_S)
64 #define UNUSED_ARG(ARG) /*@unused@*/ ARG
65 #define const /*@observer@*/ /*@temp@*/
67 #define UNUSED_ARG(ARG) ARG
70 #define STRINGIFY_(x) #x
71 #define STRINGIFY(x) STRINGIFY_(x)
74 #if defined(__GNUC_PATCHLEVEL__)
75 #define COMPILER "GCC" " " STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__) "." STRINGIFY(__GNUC_PATCHLEVEL__)
77 #define COMPILER "GCC" " " STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__)
79 #elif defined (__IMAGECRAFT__)
80 #define COMPILER "ICCAVR"
82 #define COMPILER "Unknown"
85 #define timeval_is_bigger(x,y) ((x->tv_sec > y->tv_sec) || (x->tv_sec == y->tv_sec && x->tv_usec > y->tv_usec))
86 #define timeval_is_smaler(x,y) ((x->tv_sec < y->tv_sec) || (x->tv_sec == y->tv_sec && x->tv_usec < y->tv_usec))