ObjFW  Check-in [ec6b265428]

Overview
Comment:Fix Win32 #include hell.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ec6b265428ccd3baf4b570075953e52bec6e4629680f3ec2e118c0ce89824605
User & Date: js on 2013-04-07 21:21:03
Other Links: manifest | tags
Context
2013-04-09
06:47
Check for OBJC_NEW_PROPERTIES as a fallback. check-in: 241692d895 user: js tags: trunk
2013-04-07
21:21
Fix Win32 #include hell. check-in: ec6b265428 user: js tags: trunk
2013-03-31
14:20
OFTLSSocket: Add support for SNI. check-in: 2c65fa15ef user: js tags: trunk
Changes

Modified configure.ac from [11985b8c37] to [246c410c6b].

567
568
569
570
571
572
573
574

575
576
577
578
579
580
581
582
567
568
569
570
571
572
573

574

575
576
577
578
579
580
581







-
+
-







AC_TRY_COMPILE([
	#include <stddef.h>
	#ifndef _WIN32
	# include <sys/types.h>
	# include <sys/socket.h>
	# include <netdb.h>
	#else
	# define _WIN32_WINNT 0x0501
	typedef unsigned char BOOL;
	# include <windows.h>
	# include <ws2tcpip.h>
	#endif
], [
	struct addrinfo ai;
	getaddrinfo(NULL, NULL, NULL, NULL);
], [
	AC_MSG_RESULT(yes)

Modified src/OFApplication.m from [2f474b242c] to [1d72ff5c7e].

22
23
24
25
26
27
28

29
30
31
32
33
34
35
36
37
38
39
22
23
24
25
26
27
28
29
30
31
32

33
34
35
36
37
38
39







+



-








#include <signal.h>

#import "OFApplication.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFRunLoop.h"
#ifdef OF_HAVE_THREADS
# import "OFThread.h"
#endif
#import "OFRunLoop.h"

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

#if defined(__MACH__) && !defined(OF_IOS)
# include <crt_externs.h>
#elif defined(_WIN32)

Modified src/OFObject.m from [6922597523] to [51f9346050].

22
23
24
25
26
27
28

29
30
31
32
33
34
35
36
37
38
39
22
23
24
25
26
27
28
29
30
31
32

33
34
35
36
37
38
39







+



-








#include <assert.h>

#include <sys/time.h>

#import "OFObject.h"
#import "OFTimer.h"
#import "OFRunLoop.h"
#ifdef OF_HAVE_THREADS
# import "OFThread.h"
#endif
#import "OFRunLoop.h"
#import "OFAutoreleasePool.h"

#import "OFAllocFailedException.h"
#import "OFEnumerationMutationException.h"
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFMemoryNotPartOfObjectException.h"

Modified src/OFRunLoop.h from [a581115aca] to [af319d727b].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34







-








+







 * 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 "OFObject.h"
#import "OFStream.h"
#import "OFStreamObserver.h"
#import "OFTCPSocket.h"

@class OFSortedList;
#ifdef OF_HAVE_THREADS
@class OFMutex;
#endif
@class OFTimer;
@class OFMutableDictionary;
@class OFStreamObserver;

/*!
 * @brief A class providing a run loop for the application and its processes.
 */
@interface OFRunLoop: OFObject
{
	OFSortedList *_timersQueue;

Modified src/OFRunLoop.m from [3b393cf990] to [274be6b78a].

16
17
18
19
20
21
22

23
24
25
26
27
28
29
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+








#include "config.h"

#include <assert.h>

#import "OFRunLoop.h"
#import "OFDictionary.h"
#import "OFStreamObserver.h"
#ifdef OF_HAVE_THREADS
# import "OFThread.h"
# import "OFMutex.h"
#endif
#import "OFSortedList.h"
#import "OFTimer.h"
#import "OFDate.h"

Modified src/OFStreamObserver.h from [36adc90c29] to [4cd46fa418].

13
14
15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
13
14
15
16
17
18
19





20
21
22
23
24
25
26
27







-
-
-
-
-
+







 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

#ifdef _WIN32
# ifndef _WIN32_WINNT
#  define _WIN32_WINNT 0x0501
# endif
# include <ws2tcpip.h>
# include <windows.h>
# include <winsock2.h>
#endif

@class OFStream;
@class OFMutableArray;
@class OFMutableDictionary;
@class OFDataArray;
#ifdef OF_HAVE_THREADS

Modified src/OFStreamSocket.h from [c23d3aed04] to [9529543da1].

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30



31
32



33
34
35
36
37
38
39
40
41
13
14
15
16
17
18
19



20
21
22
23
24
25
26
27
28
29
30


31
32
33
34
35
36
37
38
39
40
41
42







-
-
-








+
+
+
-
-
+
+
+









 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFStream.h"

#ifdef _WIN32
# ifndef _WIN32_WINNT
#  define _WIN32_WINNT 0x0501
# endif
# include <winsock2.h>
#endif

/*!
 * @brief A class which provides functions to create and use stream sockets.
 */
@interface OFStreamSocket: OFStream
{
#ifndef _WIN32
	int    _socket;
#else
	int  _socket;
	bool _atEndOfStream;
	SOCKET _socket;
#endif
	bool  _atEndOfStream;
}

/*!
 * @brief Returns a new, autoreleased OFTCPSocket.
 *
 * @return A new, autoreleased OFTCPSocket
 */
+ (instancetype)socket;
@end

Modified src/OFStreamSocket.m from [9ccd3888ba] to [f99014d0c7].

26
27
28
29
30
31
32




33
34
35
36
37
38
39
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43







+
+
+
+








#ifndef _WIN32
# include <sys/types.h>
# include <sys/socket.h>
#endif

#import "OFStreamSocket.h"

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

#import "OFInitializationFailedException.h"
#import "OFNotConnectedException.h"
#import "OFReadFailedException.h"
#import "OFSetOptionFailedException.h"
#import "OFWriteFailedException.h"

Modified src/OFThread.m from [36c4793f97] to [b45d9d2457].

27
28
29
30
31
32
33

34
35
36
37
38
39
40
41
42
43
44
45
27
28
29
30
31
32
33
34
35
36
37
38

39
40
41
42
43
44
45







+




-







# include <sched.h>
#endif

#ifdef __HAIKU__
# include <kernel/OS.h>
#endif

#import "OFRunLoop.h"
#import "OFThread.h"
#import "OFList.h"
#import "OFDate.h"
#import "OFSortedList.h"
#import "OFRunLoop.h"
#import "OFAutoreleasePool.h"

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

#import "OFInitializationFailedException.h"