ObjFW  Diff

Differences From Artifact [a8d789ae2b]:

To Artifact [ba3ce580f0]:


171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197




















198
199
200
201
202
203
204
205
206
	AC_SUBST(OBJC_SYNC, "objc_sync")
	AC_SUBST(OBJC_SYNC_M, "objc_sync.m")
	AC_DEFINE(NEED_OBJC_SYNC_INIT, 1,
		[Whether objc_sync_init needs to be called])])

test x"$GCC" = x"yes" && CFLAGS="$CFLAGS -Werror"
if test x"$GOBJC" = x"yes"; then
	old_OBJCFLAGS="$OBJCFLAGS"
	OBJCFLAGS="$OBJCFLAGS -Werror"

	AC_MSG_CHECKING(whether gcc has bug objc/27438)
	AC_TRY_COMPILE([
		#import <objc/objc.h>

		@interface OFConstString
		{
			Class isa;
			const char *string;
			unsigned long size;
		}
		@end

		void *_OFConstStringClassReference;
		], [
		OFConstString *test = @"";
		test++; /* Get rid of unused variable warning */
		], [AC_MSG_RESULT(no)], [




















		AC_MSG_RESULT([yes, disabling -Werror])
		OBJCFLAGS="$old_OBJCFLAGS"])
fi

if test x"$cross_compiling" = x"yes"; then
	case "$host" in
		*-*-mingw*)
			AC_PATH_PROG(WINE, wine)








<



















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|







171
172
173
174
175
176
177

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
	AC_SUBST(OBJC_SYNC, "objc_sync")
	AC_SUBST(OBJC_SYNC_M, "objc_sync.m")
	AC_DEFINE(NEED_OBJC_SYNC_INIT, 1,
		[Whether objc_sync_init needs to be called])])

test x"$GCC" = x"yes" && CFLAGS="$CFLAGS -Werror"
if test x"$GOBJC" = x"yes"; then

	OBJCFLAGS="$OBJCFLAGS -Werror"

	AC_MSG_CHECKING(whether gcc has bug objc/27438)
	AC_TRY_COMPILE([
		#import <objc/objc.h>

		@interface OFConstString
		{
			Class isa;
			const char *string;
			unsigned long size;
		}
		@end

		void *_OFConstStringClassReference;
		], [
		OFConstString *test = @"";
		test++; /* Get rid of unused variable warning */
		], [AC_MSG_RESULT(no)], [
		AC_MSG_RESULT([yes, adding -Wno-unused-variable])
		OBJCFLAGS="$OBJCFLAGS -Wno-unused-variable"])

	AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to gcc bugs)
	AC_TRY_COMPILE([
		#import <objc/objc.h>

		@interface OFObject
		{
			Class isa;
		}
		@end

		static struct {
			Class isa;
		} object;
		], [
		OFObject *test = (OFObject*)&object;
		test++; /* Get rid of unused variable warning */
		], [AC_MSG_RESULT(no)], [
		AC_MSG_RESULT(yes)
		OBJCFLAGS="$OBJCFLAGS -Wno-strict-aliasing"])
fi

if test x"$cross_compiling" = x"yes"; then
	case "$host" in
		*-*-mingw*)
			AC_PATH_PROG(WINE, wine)