ObjFW  Diff

Differences From Artifact [fa1a2c06ef]:

To Artifact [f38056ff53]:


1
2

3
4
5
6
7
8
9
1

2
3
4
5
6
7
8
9

-
+







/*
 * Copyright (c) 2008-2022 Jonathan Schleifer <js@nil.im>
 * Copyright (c) 2008-2023 Jonathan Schleifer <js@nil.im>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
60
61
62
63
64
65
66

67

68
69
70
71
72
73
74
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76







+

+







#endif

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

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# undef Class
#endif

#ifdef OF_APPLE_RUNTIME
extern id _Nullable _objc_rootAutorelease(id _Nullable object);
#endif
#if defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR)
extern id OFForward(id, SEL, ...);
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
391
392
393
394
395
396
397

398
399
400
401
402
403
404







-







}

/* References for static linking */
void
_references_to_categories_of_OFObject(void)
{
	_OFObject_KeyValueCoding_reference = 1;
	_OFObject_Serialization_reference = 1;
}

@implementation OFObject
+ (void)load
{
#if !defined(OF_APPLE_RUNTIME) || defined(__OBJC2__)
	objc_setUncaughtExceptionHandler(uncaughtExceptionHandler);
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
442
443
444
445
446
447
448





449
450
451
452
453
454
455







-
-
-
-
-







}

+ (instancetype)alloc
{
	return OFAllocObject(self, 0, 0, NULL);
}

+ (instancetype)new
{
	return [[self alloc] init];
}

+ (Class)class
{
	return self;
}

+ (OFString *)className
{
478
479
480
481
482
483
484
485
486

487
488

489
490
491
492
493
494
495
474
475
476
477
478
479
480


481


482
483
484
485
486
487
488
489







-
-
+
-
-
+







+ (bool)instancesRespondToSelector: (SEL)selector
{
	return class_respondsToSelector(self, selector);
}

+ (bool)conformsToProtocol: (Protocol *)protocol
{
	Class c;

	for (Class iter = self; iter != Nil; iter = class_getSuperclass(iter))
	for (c = self; c != Nil; c = class_getSuperclass(c))
		if (class_conformsToProtocol(c, protocol))
		if (class_conformsToProtocol(iter, protocol))
			return true;

	return false;
}

+ (IMP)instanceMethodForSelector: (SEL)selector
{
583
584
585
586
587
588
589
590

591
592
593
594
595

596
597
598
599
600
601
602
577
578
579
580
581
582
583

584
585
586
587
588

589
590
591
592
593
594
595
596







-
+




-
+







	}

	[self inheritMethodsFromClass: superclass];
}

+ (bool)resolveClassMethod: (SEL)selector
{
	return NO;
	return false;
}

+ (bool)resolveInstanceMethod: (SEL)selector
{
	return NO;
	return false;
}

- (instancetype)init
{
	return self;
}