ObjFW  Check-in [f372f73c49]

Overview
Comment:OFSystemInfo: Use if (@available(...))

This avoids referencing the deprecated symbols even though the
replacements are available, which resulted in App Store rejection.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f372f73c4956e5805ffa518f9fdac197edcf510aeb28b65d0297e9ccf69cdc0b
User & Date: js on 2021-08-07 22:51:17
Other Links: manifest | tags
Context
2021-08-07
23:25
Make Apple GCC 4.0.1 happy again check-in: 176e97bd4d user: js tags: trunk
22:51
OFSystemInfo: Use if (@available(...)) check-in: f372f73c49 user: js tags: trunk
2021-07-25
17:18
OFTLSKey.m: Fix typo check-in: 48a536b2a4 user: js tags: trunk
Changes

Modified src/OFSystemInfo.m from [b33fc4fe1c] to [da4a435ab7].

350
351
352
353
354
355
356
357

358
359
360
361
362
363
364
365
350
351
352
353
354
355
356

357

358
359
360
361
362
363
364







-
+
-







+ (OFString *)userDataPath
{
# if defined(OF_MACOS) || defined(OF_IOS)
	char pathC[PATH_MAX];
	OFMutableString *path;

#  ifdef HAVE_SYSDIR_START_SEARCH_PATH_ENUMERATION
	/* (1) to disable dead code warning when it is not a weak symbol */
	if (@available(macOS 10.12, iOS 10, *)) {
	if ((1) && &sysdir_start_search_path_enumeration != NULL) {
		sysdir_search_path_enumeration_state state;

		state = sysdir_start_search_path_enumeration(
		    SYSDIR_DIRECTORY_APPLICATION_SUPPORT,
		    SYSDIR_DOMAIN_MASK_USER);
		if (sysdir_get_next_search_path_enumeration(state, pathC) == 0)
			@throw [OFNotImplementedException
443
444
445
446
447
448
449
450

451
452
453
454
455
456
457
458
442
443
444
445
446
447
448

449

450
451
452
453
454
455
456







-
+
-







+ (OFString *)userConfigPath
{
# if defined(OF_MACOS) || defined(OF_IOS)
	char pathC[PATH_MAX];
	OFMutableString *path;

#  ifdef HAVE_SYSDIR_START_SEARCH_PATH_ENUMERATION
	/* (1) to disable dead code warning when it is not a weak symbol */
	if (@available(macOS 10.12, iOS 10, *)) {
	if ((1) && &sysdir_start_search_path_enumeration != NULL) {
		sysdir_search_path_enumeration_state state;

		state = sysdir_start_search_path_enumeration(
		    SYSDIR_DIRECTORY_LIBRARY, SYSDIR_DOMAIN_MASK_USER);
		if (sysdir_get_next_search_path_enumeration(state, pathC) == 0)
			@throw [OFNotImplementedException
			    exceptionWithSelector: _cmd