ObjFW  Check-in [4285aea3c6]

Overview
Comment:Always use our _Block_copy.

The reason is that the _Block_copy from libSystem references the wrong
_NSConcreteMallocBlock.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4285aea3c612cdaae62adff6bcec5016892132380a1d7119b61b1ecbdea6005b
User & Date: js on 2010-11-12 16:00:09
Other Links: manifest | tags
Context
2010-11-12
19:36
Ensure OF{Stack,Global,Malloc}Block get initialized. check-in: 38bde7146a user: js tags: trunk
16:00
Always use our _Block_copy. check-in: 4285aea3c6 user: js tags: trunk
15:08
Make blocks work with the old Apple ObjC runtime. check-in: 7a6f696ef3 user: js tags: trunk
Changes

Modified configure.ac from [f0b04b1354] to [759504b92f].

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
	AC_DEFINE(OF_HAVE_BLOCKS, 1, [Compiler support for blocks])
	AC_SUBST(BLOCKS_FLAGS, "-fblocks")
	AC_MSG_RESULT(yes)
	], [
	AC_MSG_RESULT(no)
	OBJCFLAGS="$old_OBJCFLAGS"
	])
AC_CHECK_FUNC(_Block_copy,
	AC_DEFINE(HAVE_BLOCK_COPY, 1, [Whether we have _Block_copy]))

AC_CHECK_HEADERS([objfw-rt.h objc/objc.h])

test x"$ac_cv_header_objfw_rt_h" = x"yes" && objc_runtime="ObjFW-RT"

if test x"$ac_cv_header_objc_objc_h" = x"yes"; then
	dnl TODO: This is ugly. Let's think of a better check.







<
<







71
72
73
74
75
76
77


78
79
80
81
82
83
84
	AC_DEFINE(OF_HAVE_BLOCKS, 1, [Compiler support for blocks])
	AC_SUBST(BLOCKS_FLAGS, "-fblocks")
	AC_MSG_RESULT(yes)
	], [
	AC_MSG_RESULT(no)
	OBJCFLAGS="$old_OBJCFLAGS"
	])



AC_CHECK_HEADERS([objfw-rt.h objc/objc.h])

test x"$ac_cv_header_objfw_rt_h" = x"yes" && objc_runtime="ObjFW-RT"

if test x"$ac_cv_header_objc_objc_h" = x"yes"; then
	dnl TODO: This is ugly. Let's think of a better check.

Modified src/OFBlock.m from [0576db1a73] to [86829d5175].

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
struct class _NSConcreteMallocBlock;
#else
extern void *_NSConcreteStackBlock;
extern void *_NSConcreteGlobalBlock;
extern void *_NSConcreteMallocBlock;
#endif

#ifndef HAVE_BLOCK_COPY
static struct {
	Class isa;
} alloc_failed_exception;

void*
_Block_copy(const void *block_)
{







<







128
129
130
131
132
133
134

135
136
137
138
139
140
141
struct class _NSConcreteMallocBlock;
#else
extern void *_NSConcreteStackBlock;
extern void *_NSConcreteGlobalBlock;
extern void *_NSConcreteMallocBlock;
#endif


static struct {
	Class isa;
} alloc_failed_exception;

void*
_Block_copy(const void *block_)
{
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
				obj->byref_dispose(obj);

			free(obj);
		}
		break;
	}
}
#endif

/// \cond internal
@implementation OFBlock
#if defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__)
+ (void)load
{
	Class tmp;







<







243
244
245
246
247
248
249

250
251
252
253
254
255
256
				obj->byref_dispose(obj);

			free(obj);
		}
		break;
	}
}


/// \cond internal
@implementation OFBlock
#if defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__)
+ (void)load
{
	Class tmp;