ObjFW  Check-in [4a7b3657d0]

Overview
Comment:Fix building for Windows
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4a7b3657d02f267284f88c14a7e15f6bbb1bcb82c30a92999b84a3dc74a8681f
User & Date: js on 2020-11-28 19:28:38
Other Links: manifest | tags
Context
2020-11-29
00:59
of_bitset_*: Use CHAR_BIT instead of 8 check-in: b46492384a user: js tags: trunk
2020-11-28
19:28
Fix building for Windows check-in: 4a7b3657d0 user: js tags: trunk
11:07
Fix detection of macOS check-in: f9208b6837 user: js tags: trunk
Changes

Modified src/OFApplication.m from [ba8b4a32b1] to [b8581aaf02].

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
					fprintf(stderr,
					    "Warning: Invalid environment "
					    "variable: %s\n", tmp.UTF8String);
					continue;
				}

				key = [tmp substringToIndex: pos];
				value = [tmp substringFromRange: pos + 1];

				[_environment setObject: value
						 forKey: key];

				objc_autoreleasePoolPop(pool);
			}








|







256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
					fprintf(stderr,
					    "Warning: Invalid environment "
					    "variable: %s\n", tmp.UTF8String);
					continue;
				}

				key = [tmp substringToIndex: pos];
				value = [tmp substringFromIndex: pos + 1];

				[_environment setObject: value
						 forKey: key];

				objc_autoreleasePoolPop(pool);
			}

Modified src/OFWindowsRegistryKey.m from [db8bc56ab6] to [ae5fc782fa].

357
358
359
360
361
362
363

364
365
366
367
368
369
370
371
372
	     type: (DWORD)type
{
	void *pool = objc_autoreleasePoolPush();
	OFData *data;

	if ([OFSystemInfo isWindowsNT])
		data = [OFData dataWithItems: string.UTF16String

				    itemSize: sizeof(of_char16_t)
				       count: string.UTF16StringLength + 1];
	else {
		of_string_encoding_t encoding = [OFLocale encoding];
		const char *cString = [string cStringWithEncoding: encoding];
		size_t length = [string cStringLengthWithEncoding: encoding];

		data = [OFData dataWithItems: cString
				       count: length + 1];







>
|
<







357
358
359
360
361
362
363
364
365

366
367
368
369
370
371
372
	     type: (DWORD)type
{
	void *pool = objc_autoreleasePoolPush();
	OFData *data;

	if ([OFSystemInfo isWindowsNT])
		data = [OFData dataWithItems: string.UTF16String
				       count: string.UTF16StringLength + 1
				    itemSize: sizeof(of_char16_t)];

	else {
		of_string_encoding_t encoding = [OFLocale encoding];
		const char *cString = [string cStringWithEncoding: encoding];
		size_t length = [string cStringLengthWithEncoding: encoding];

		data = [OFData dataWithItems: cString
				       count: length + 1];