Artifact bc099d612bf611490945980a16b9072e2e5d31a247faa2c52edd932ffe59d7c0:
- File
src/socket.h
— part of check-in
[4de1f2a67a]
at
2014-03-05 00:31:49
on branch trunk
— Move netinet/in.h include to socket.h
This is required as OFKernelEventObserver uses struct sockaddr_in as an
instance variable in case there is no pipe(). (user: js, size: 1370) [annotate] [blame] [check-ins using]
/* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "objfw-defs.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif #include <stdbool.h> #ifdef OF_HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef OF_HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef _WIN32 # ifdef __MINGW32__ # include <_mingw.h> # ifdef __MINGW64_VERSION_MAJOR # include <winsock2.h> # endif # endif # include <windows.h> # include <ws2tcpip.h> #endif #ifdef __wii__ # define BOOL OGC_BOOL # include <network.h> # undef BOOL struct sockaddr_storage { u8 ss_len; u8 ss_family; u8 ss_data[14]; }; #endif #ifdef _PSP # include <stdint.h> struct sockaddr_storage { uint8_t ss_len; sa_family_t ss_family; in_port_t ss_data1; struct in_addr ss_data2; int8_t ss_data3[8]; }; #endif extern bool of_init_sockets(void);