Differences From Artifact [f176d35c0c]:
- File src/OFObject.h — part of check-in [860b0bf1e9] at 2023-07-15 20:57:41 on branch amiga-library — Merge trunk into branch "amiga-library" (user: js, size: 43248) [annotate] [blame] [check-ins using] [more...]
To Artifact [2c787e015d]:
- File
src/OFObject.h
— part of check-in
[14c70763b0]
at
2023-08-05 09:04:27
on branch trunk
— Remove hacks in headers for C compatibility
A better approach would probably be to have a separate header which
makes some classes available to pure C. (user: js, size: 43050) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
9 10 11 12 13 14 15 | * * 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. */ | < < < | | 9 10 11 12 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 | * * 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 "objfw-defs.h" #ifndef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS #endif #ifndef __STDC_CONSTANT_MACROS # define __STDC_CONSTANT_MACROS #endif #include <stddef.h> #include <stdint.h> #include <stdbool.h> #include <limits.h> #include "macros.h" #import "OFOnce.h" /* * Some versions of MinGW require <winsock2.h> to be included before * <windows.h>. Do this here to make sure this is always done in the correct * order, even if another header includes just <windows.h>. */ #ifdef __MINGW32__ |
︙ | ︙ | |||
453 454 455 456 457 458 459 | tmp += tmp << 15; *hash = tmp; } static const size_t OFNotFound = SIZE_MAX; | < | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 | tmp += tmp << 15; *hash = tmp; } static const size_t OFNotFound = SIZE_MAX; @class OFMethodSignature; @class OFString; @class OFThread; /** * @protocol OFObject OFObject.h ObjFW/OFObject.h * |
︙ | ︙ | |||
676 677 678 679 680 681 682 | /** * @brief Retain a weak reference to this object. * * @return Whether a weak reference to this object has been retained */ - (bool)retainWeakReference; @end | < < | | | | | | | | | | | 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 | /** * @brief Retain a weak reference to this object. * * @return Whether a weak reference to this object has been retained */ - (bool)retainWeakReference; @end /** * @class OFObject OFObject.h ObjFW/OFObject.h * * @brief The root class for all other classes inside ObjFW. */ OF_ROOT_CLASS @interface OFObject <OFObject> { @private #ifndef __clang_analyzer__ Class _isa; #else Class _isa __attribute__((__unused__)); #endif } #ifdef OF_HAVE_CLASS_PROPERTIES # ifndef __cplusplus @property (class, readonly, nonatomic) Class class; # else @property (class, readonly, nonatomic, getter=class) Class class_; # endif @property (class, readonly, nonatomic) OFString *className; @property (class, readonly, nullable, nonatomic) Class superclass; @property (class, readonly, nonatomic) OFString *description; #endif #ifndef __cplusplus @property (readonly, nonatomic) Class class; #else @property (readonly, nonatomic, getter=class) Class class_; #endif @property OF_NULLABLE_PROPERTY (readonly, nonatomic) Class superclass; @property (readonly, nonatomic) unsigned long hash; @property (readonly, nonatomic) unsigned int retainCount; @property (readonly, nonatomic) bool isProxy; @property (readonly, nonatomic) bool allowsWeakReference; |
︙ | ︙ | |||
1054 1055 1056 1057 1058 1059 1060 | - (void)performSelector: (SEL)selector withObject: (nullable id)object1 withObject: (nullable id)object2 withObject: (nullable id)object3 withObject: (nullable id)object4 afterDelay: (OFTimeInterval)delay; | | | 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 | - (void)performSelector: (SEL)selector withObject: (nullable id)object1 withObject: (nullable id)object2 withObject: (nullable id)object3 withObject: (nullable id)object4 afterDelay: (OFTimeInterval)delay; #ifdef OF_HAVE_THREADS /** * @brief Performs the specified selector on the specified thread. * * @param selector The selector to perform * @param thread The thread on which to perform the selector * @param waitUntilDone Whether to wait until the perform finished */ |
︙ | ︙ | |||
1312 1313 1314 1315 1316 1317 1318 | - (void)performSelector: (SEL)selector onThread: (OFThread *)thread withObject: (nullable id)object1 withObject: (nullable id)object2 withObject: (nullable id)object3 withObject: (nullable id)object4 afterDelay: (OFTimeInterval)delay; | | | 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 | - (void)performSelector: (SEL)selector onThread: (OFThread *)thread withObject: (nullable id)object1 withObject: (nullable id)object2 withObject: (nullable id)object3 withObject: (nullable id)object4 afterDelay: (OFTimeInterval)delay; #endif /** * @brief This method is called when @ref resolveClassMethod: or * @ref resolveInstanceMethod: returned false. It should return a target * to which the message should be forwarded. * * @note When the message should not be forwarded, you should not return `nil`, |
︙ | ︙ | |||
1338 1339 1340 1341 1342 1343 1344 | * returns! * * @param selector The selector not understood by the receiver * @throw OFNotImplementedException */ - (void)doesNotRecognizeSelector: (SEL)selector OF_NO_RETURN; @end | < < < < | 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 | * returns! * * @param selector The selector not understood by the receiver * @throw OFNotImplementedException */ - (void)doesNotRecognizeSelector: (SEL)selector OF_NO_RETURN; @end /** * @protocol OFCopying OFObject.h ObjFW/OFObject.h * * @brief A protocol for the creation of copies. */ @protocol OFCopying /** |
︙ | ︙ | |||
1394 1395 1396 1397 1398 1399 1400 | * @brief Compares the object to another object. * * @param object An object to compare the object to * @return The result of the comparison */ - (OFComparisonResult)compare: (id <OFComparing>)object; @end | < | 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 | * @brief Compares the object to another object. * * @param object An object to compare the object to * @return The result of the comparison */ - (OFComparisonResult)compare: (id <OFComparing>)object; @end #ifdef __cplusplus extern "C" { #endif /** * @brief Allocates memory for the specified number of items of the specified * size. |
︙ | ︙ | |||
1508 1509 1510 1511 1512 1513 1514 | extern uint64_t OFRandom64(void); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END | | < < | < < < | 1497 1498 1499 1500 1501 1502 1503 1504 1505 | extern uint64_t OFRandom64(void); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END #import "OFBlock.h" #import "OFObject+KeyValueCoding.h" |