2 This file is part of GNUnet.
3 (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file include/platform.h
23 * @brief plaform specifics
27 * This file should never be included by installed
28 * header files (thos starting with "gnunet_").
34 #ifndef HAVE_USED_CONFIG_H
35 #define HAVE_USED_CONFIG_H
37 #include "gnunet_config.h"
42 #define BREAKPOINT asm("int $3;");
43 #define GNUNET_SIGCHLD 17
46 #define GNUNET_SIGCHLD SIGCHLD
49 #ifdef HAVE_SYS_TYPES_H
50 #include <sys/types.h>
53 #define ALLOW_EXTRA_CHECKS GNUNET_NO
56 * For strptime (glibc2 needs this).
66 /* configuration options */
68 #define VERBOSE_STATS 0
71 #include <sys/reent.h>
76 #define FD_SETSIZE 1024
83 #include <sys/socket.h>
86 #include <netinet/in.h>
88 #if HAVE_NETINET_IN_SYSTM_H
89 #include <netinet/in_systm.h>
91 #include <netinet/ip.h> /* superset of previous */
92 #include <arpa/inet.h>
93 #include <netinet/tcp.h>
95 #include <sys/ioctl.h>
112 #include <malloc.h> /* for alloca(), on other OSes it's in stdlib.h */
115 #include <unistd.h> /* KLB_FIX */
117 #include <sys/stat.h>
118 #include <sys/types.h>
120 #include <dirent.h> /* KLB_FIX */
125 #include <sys/param.h>
127 #if TIME_WITH_SYS_TIME
128 #include <sys/time.h>
132 #include <sys/time.h>
141 #ifdef GNUNET_freeBSD
142 #include <semaphore.h>
146 #include <semaphore.h>
153 #include <sys/sockio.h>
154 #include <sys/filio.h>
155 #include <sys/loadavg.h>
156 #include <semaphore.h>
163 #include <cygwin/if.h>
176 #if HAVE_SYS_RESOURCE_H
177 #include <sys/resource.h>
183 #if HAVE_SYS_ENDIAN_H
184 #include <sys/endian.h>
190 #ifndef FRAMEWORK_BUILD
193 * GNU gettext support macro.
195 #define _(String) dgettext("gnunet",String)
196 #define LIBEXTRACTOR_GETTEXT_DOMAIN "libextractor"
198 #include "libintlemu.h"
199 #define _(String) dgettext("org.gnunet.gnunet",String)
200 #define LIBEXTRACTOR_GETTEXT_DOMAIN "org.gnunet.libextractor"
204 #define SIOCGIFCONF _IOW('s', 100, struct ifconf) /* get if list */
205 #define SIOCGIFFLAGS _IOW('s', 101, struct ifreq) /* Get if flags */
206 #define SIOCGIFADDR _IOW('s', 102, struct ifreq) /* Get if addr */
210 #include <sys/mman.h>
214 #define __BYTE_ORDER BYTE_ORDER
215 #define __BIG_ENDIAN BIG_ENDIAN
219 #define __BYTE_ORDER BYTE_ORDER
220 #define __BIG_ENDIAN BIG_ENDIAN
221 /* not available on darwin, override configure */
229 atoll (const char *nptr);
233 #include "langinfo.h"
237 #define SIZE_MAX ((size_t)(-1))
241 #define O_LARGEFILE 0
244 #if defined(__sparc__)
245 #define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove(&__tmp, &(val), sizeof((val))); __tmp; })
247 #define MAKE_UNALIGNED(val) val
251 #define FDTYPE HANDLE
252 #define SOCKTYPE SOCKET