ObjFW  Check-in [fab07a40ca]

Overview
Comment:Fix compilation with mingw32
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fab07a40cabd369cd33c226e99ccfb38ea2352f3cdb1de928065f380053a79a3
User & Date: js on 2014-02-12 03:17:01
Other Links: manifest | tags
Context
2014-02-12
03:17
Fix compilation with mingw-w64 check-in: 6ba4095f05 user: js tags: trunk
03:17
Fix compilation with mingw32 check-in: fab07a40ca user: js tags: trunk
00:10
Fix --enable-seluid24 check-in: 17b2d32959 user: js tags: trunk
Changes

Modified src/OFFile.m from [79751d7dbc] to [8e458eea83].

324
325
326
327
328
329
330

331

332
333
334
335
336
337
338
339
340
341


342
343
344
345
346
347
348

	objc_autoreleasePoolPop(pool);
}

+ (OFArray*)contentsOfDirectoryAtPath: (OFString*)path
{
	OFMutableArray *files;

	of_string_encoding_t encoding;


	if (path == nil)
		@throw [OFInvalidArgumentException exception];

	files = [OFMutableArray array];
	encoding = [OFString nativeOSEncoding];

#ifndef _WIN32
	DIR *dir;
	struct dirent *dirent;



	if ((dir = opendir([path cStringWithEncoding: encoding])) == NULL)
		@throw [OFOpenFileFailedException exceptionWithPath: path
							       mode: @"r"];

	@try {
		while ((dirent = readdir(dir)) != NULL) {







>

>





<




>
>







324
325
326
327
328
329
330
331
332
333
334
335
336
337
338

339
340
341
342
343
344
345
346
347
348
349
350
351

	objc_autoreleasePoolPop(pool);
}

+ (OFArray*)contentsOfDirectoryAtPath: (OFString*)path
{
	OFMutableArray *files;
#ifndef _WIN32
	of_string_encoding_t encoding;
#endif

	if (path == nil)
		@throw [OFInvalidArgumentException exception];

	files = [OFMutableArray array];


#ifndef _WIN32
	DIR *dir;
	struct dirent *dirent;

	encoding = [OFString nativeOSEncoding];

	if ((dir = opendir([path cStringWithEncoding: encoding])) == NULL)
		@throw [OFOpenFileFailedException exceptionWithPath: path
							       mode: @"r"];

	@try {
		while ((dirent = readdir(dir)) != NULL) {
642
643
644
645
646
647
648

649

650
651
652
653
654
655
656
657
658
659
660
661
662

663
664
665
666
667
668
669
670
671
672
}

+ (void)moveItemAtPath: (OFString*)source
		toPath: (OFString*)destination
{
	void *pool;
	of_stat_t s;

	of_string_encoding_t encoding;


	if (source == nil || destination == nil)
		@throw [OFInvalidArgumentException exception];

	pool = objc_autoreleasePoolPush();

	if (of_lstat(destination, &s) == 0) {
		errno = EEXIST;
		@throw [OFCopyItemFailedException
		    exceptionWithSourcePath: source
			    destinationPath: destination];
	}


	encoding = [OFString nativeOSEncoding];

#ifndef _WIN32
	if (rename([source cStringWithEncoding: encoding],
	    [destination cStringWithEncoding: encoding])) {
#else
	if (_wrename([source UTF16String], [destination UTF16String])) {
#endif
		if (errno != EXDEV)
			@throw [OFMoveItemFailedException







>

>













>


<







645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670

671
672
673
674
675
676
677
}

+ (void)moveItemAtPath: (OFString*)source
		toPath: (OFString*)destination
{
	void *pool;
	of_stat_t s;
#ifndef _WIN32
	of_string_encoding_t encoding;
#endif

	if (source == nil || destination == nil)
		@throw [OFInvalidArgumentException exception];

	pool = objc_autoreleasePoolPush();

	if (of_lstat(destination, &s) == 0) {
		errno = EEXIST;
		@throw [OFCopyItemFailedException
		    exceptionWithSourcePath: source
			    destinationPath: destination];
	}

#ifndef _WIN32
	encoding = [OFString nativeOSEncoding];


	if (rename([source cStringWithEncoding: encoding],
	    [destination cStringWithEncoding: encoding])) {
#else
	if (_wrename([source UTF16String], [destination UTF16String])) {
#endif
		if (errno != EXDEV)
			@throw [OFMoveItemFailedException

Modified src/OFTCPSocket.m from [2d27dcba2c] to [96ae0860b7].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * 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.
 */

#include "config.h"

#define _WIN32_WINNT 0x0501
#define __NO_EXT_QNX

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <assert.h>







<







12
13
14
15
16
17
18

19
20
21
22
23
24
25
 * 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.
 */

#include "config.h"


#define __NO_EXT_QNX

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <assert.h>

Modified src/resolver.m from [028e90eddf] to [1037374b48].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
 * 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.
 */

#include "config.h"



#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>

#import "macros.h"







>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * 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.
 */

#include "config.h"

#define _WIN32_WINNT 0x0501

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>

#import "macros.h"

Modified src/socket.h from [49c77e6e7b] to [ef3d903192].

23
24
25
26
27
28
29

30
31
32
33
34
35
36
#include <stdbool.h>

#ifdef OF_HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif

#ifdef _WIN32

# include <ws2tcpip.h>
#endif

#ifdef __wii__
# define BOOL OGC_BOOL
# include <network.h>
# undef BOOL







>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdbool.h>

#ifdef OF_HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif

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

#ifdef __wii__
# define BOOL OGC_BOOL
# include <network.h>
# undef BOOL