ObjFW  Check-in [d9ae4fa74a]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix OF_DIRECT_MEMBERS with Clang 21
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d9ae4fa74a680c9e29aba3e8a9735b7cf30ccb3d52cf710b76864c2d0d790bd1
User & Date: js 2025-03-26 02:24:20.716
Context
2025-03-26
21:36
Improve fix from last commit check-in: 50c8ec637e user: js tags: trunk
02:24
Fix OF_DIRECT_MEMBERS with Clang 21 check-in: d9ae4fa74a user: js tags: trunk
00:18
Allow OF_DIRECT with ObjFW runtime if Clang >= 21 check-in: 5d529cc132 user: js tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/OFINISection.m.
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
	if (self != [OFINISection class])
		return;

	needsEscapeCharacterSet = [[OFCharacterSet alloc]
	    initWithCharactersInString: @"\r\n\f\"\\=;#"];
}

- (instancetype)of_initWithName: (OFString *)name OF_DIRECT
{
	self = [super init];

	@try {
		_name = [name copy];
		_lines = [[OFMutableArray alloc] init];
	} @catch (id e) {







|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
	if (self != [OFINISection class])
		return;

	needsEscapeCharacterSet = [[OFCharacterSet alloc]
	    initWithCharactersInString: @"\r\n\f\"\\=;#"];
}

- (instancetype)of_initWithName: (OFString *)name
{
	self = [super init];

	@try {
		_name = [name copy];
		_lines = [[OFMutableArray alloc] init];
	} @catch (id e) {
Changes to src/OFUDPSocket.m.
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#import "OFAlreadyOpenException.h"
#import "OFBindIPSocketFailedException.h"

@implementation OFUDPSocket
@dynamic delegate;

- (void)of_bindToAddress: (OFSocketAddress *)address
	       extraType: (int)extraType OF_DIRECT
{
#if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL) && defined(FD_CLOEXEC)
	int flags;
#endif
#if !defined(OF_HPUX) && !defined(OF_WII) && !defined(OF_NINTENDO_3DS)
	OFString *host;
	uint16_t port;







|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#import "OFAlreadyOpenException.h"
#import "OFBindIPSocketFailedException.h"

@implementation OFUDPSocket
@dynamic delegate;

- (void)of_bindToAddress: (OFSocketAddress *)address
	       extraType: (int)extraType
{
#if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL) && defined(FD_CLOEXEC)
	int flags;
#endif
#if !defined(OF_HPUX) && !defined(OF_WII) && !defined(OF_NINTENDO_3DS)
	OFString *host;
	uint16_t port;
Changes to src/macros.h.
329
330
331
332
333
334
335

336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360

#if __has_attribute(__swift_name__)
# define OF_SWIFT_NAME(name) __attribute__((__swift_name__(name)))
#else
# define OF_SWIFT_NAME(name)
#endif


#if defined(OF_APPLE_RUNTIME) || (defined(OF_OBJFW_RUNTIME) && \
    defined(__clang_major__) && __clang_major__ >= 21)
# if __has_attribute(__objc_direct__)
#  define OF_DIRECT __attribute__((__objc_direct__))
#  define OF_DIRECT_PROPERTY(...) (__VA_ARGS__, direct)
# endif
# if __has_attribute(__objc_direct_members__) && defined(OF_APPLE_RUNTIME)
#  define OF_DIRECT_MEMBERS __attribute__((__objc_direct_members__))
# endif
#endif
#ifndef OF_DIRECT
# define OF_DIRECT
#endif
#ifndef OF_DIRECT_PROPERTY
# define OF_DIRECT_PROPERTY
#endif
#ifndef OF_DIRECT_MEMBERS
# define OF_DIRECT_MEMBERS
#endif

#ifdef OF_APPLE_RUNTIME
# if defined(OF_AMD64) || defined(OF_X86) || defined(OF_ARM64) || \
    defined(OF_ARM) || defined(OF_POWERPC)
#  define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR
#  define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET







>
|
|
<
|
<
<
<
|
<
<
<
|
|
<
|
<
|
|







329
330
331
332
333
334
335
336
337
338

339



340



341
342

343

344
345
346
347
348
349
350
351
352

#if __has_attribute(__swift_name__)
# define OF_SWIFT_NAME(name) __attribute__((__swift_name__(name)))
#else
# define OF_SWIFT_NAME(name)
#endif

#if __has_attribute(__objc_direct__) && (defined(OF_APPLE_RUNTIME) || \
    (defined(OF_OBJFW_RUNTIME) && defined(__clang_major__) && \
    __clang_major__ >= 21))

# define OF_DIRECT __attribute__((__objc_direct__))



# define OF_DIRECT_MEMBERS __attribute__((__objc_direct_members__))



# define OF_DIRECT_PROPERTY(...) (__VA_ARGS__, direct)
#else

# define OF_DIRECT

# define OF_DIRECT_MEMBERS
# define OF_DIRECT_PROPERTY
#endif

#ifdef OF_APPLE_RUNTIME
# if defined(OF_AMD64) || defined(OF_X86) || defined(OF_ARM64) || \
    defined(OF_ARM) || defined(OF_POWERPC)
#  define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR
#  define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET