ObjFW  Diff

Differences From Artifact [8b0d12d65c]:

To Artifact [a3d6727f88]:

  • File src/OFStreamObserver.m — part of check-in [81d47f4398] at 2014-01-25 19:33:57 on branch trunk — Move socket includes and helpers to separate files

    The new file socket.h includes all headers required for sockets on the
    used platform, while the file socket_helpers.h defines the BSD API
    functions to the platform specific functions if necessary.

    This cleans up the classes dealing with sockets a lot and also reduces
    code duplication. (user: js, size: 8915) [annotate] [blame] [check-ins using]


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#if defined(HAVE_POLL_H) || defined(__wii__)
# import "OFStreamObserver_poll.h"
#endif
#if defined(HAVE_SYS_SELECT_H) || defined(_WIN32)
# import "OFStreamObserver_select.h"
#endif

#ifdef _WIN32
# include <ws2tcpip.h>
#endif

#import "OFInitializationFailedException.h"
#import "OFOutOfRangeException.h"

#import "autorelease.h"
#import "macros.h"

#ifdef __wii__
# define BOOL OGC_BOOL
# include <network.h>
# undef BOOL
# define bind(sock, addr, addrlen) net_bind(sock, addr, addrlen)
# define sendto(sock, buf, len, flags, addr, addrlen) \
	net_sendto(sock, buf, len, flags, addr, addrlen)
# define socket(domain, type, proto) net_socket(domain, type, proto)
#endif

enum {
	QUEUE_ADD = 0,
	QUEUE_REMOVE = 1,
	QUEUE_READ = 0,
	QUEUE_WRITE = 2
};







<
<
<
<





|
<
<
<
<
<
<
<
<
<







43
44
45
46
47
48
49




50
51
52
53
54
55









56
57
58
59
60
61
62
#if defined(HAVE_POLL_H) || defined(__wii__)
# import "OFStreamObserver_poll.h"
#endif
#if defined(HAVE_SYS_SELECT_H) || defined(_WIN32)
# import "OFStreamObserver_select.h"
#endif





#import "OFInitializationFailedException.h"
#import "OFOutOfRangeException.h"

#import "autorelease.h"
#import "macros.h"
#import "socket_helpers.h"










enum {
	QUEUE_ADD = 0,
	QUEUE_REMOVE = 1,
	QUEUE_READ = 0,
	QUEUE_WRITE = 2
};