ObjFW  Check-in [989363c9fd]

Overview
Comment:configure: Go back to using -std=gnu*

Using -std=c* causes all kinds of problems with different OSes (some
need a _GNU_SOURCE define when using -std=c*, others simply don't
declare some functions at all due to __STRICT_ANSI__ being defined by
-std=c*).

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 989363c9fdfec18a826d7a983740fb6bc9f4fe83d89a171491746f8ca822ade4
User & Date: js on 2015-05-16 12:44:31
Other Links: manifest | tags
Context
2015-05-16
15:16
OFKernelEventObserver_select: Ensure fd >= 0 check-in: a54a47a4c3 user: js tags: trunk
12:44
configure: Go back to using -std=gnu* check-in: 989363c9fd user: js tags: trunk
11:16
utils/ofhttp: Default User-Agent to OFHTTP check-in: 625377fca5 user: js tags: trunk
Changes

Modified configure.ac from [9759d99d2a] to [0f82546aef].

83
84
85
86
87
88
89
90
91


92
93
94


95
96
97


98
99
100
101
102
103
104
83
84
85
86
87
88
89


90
91
92


93
94
95


96
97
98
99
100
101
102
103
104







-
-
+
+

-
-
+
+

-
-
+
+







])

CPP="$OBJCPP"
CPPFLAGS="$CPPFLAGS $OBJCPPFLAGS"
OBJCFLAGS="$OBJCFLAGS -Wall -fexceptions -fobjc-exceptions -funwind-tables"
OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstantString"

AX_CHECK_COMPILER_FLAGS(-std=c11, [
	OBJCFLAGS="$OBJCFLAGS -std=c11"
AX_CHECK_COMPILER_FLAGS(-std=gnu11, [
	OBJCFLAGS="$OBJCFLAGS -std=gnu11"
], [
	AX_CHECK_COMPILER_FLAGS(-std=c1x, [
		OBJCFLAGS="$OBJCFLAGS -std=c1x"
	AX_CHECK_COMPILER_FLAGS(-std=gnu1x, [
		OBJCFLAGS="$OBJCFLAGS -std=gnu1x"
	], [
		AX_CHECK_COMPILER_FLAGS(-std=c99,
			[OBJCFLAGS="$OBJCFLAGS -std=c99"])
		AX_CHECK_COMPILER_FLAGS(-std=gnu99,
			[OBJCFLAGS="$OBJCFLAGS -std=gnu99"])
	])
])

AX_CHECK_COMPILER_FLAGS(-pipe, [OBJCFLAGS="$OBJCFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCFLAGS="$OBJCFLAGS -fno-common"])
AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings, [
	OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings"
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
177
178
179
180
181
182
183














184
185
186
187
188
189
190







-
-
-
-
-
-
-
-
-
-
-
-
-
-







AC_DEFINE_UNQUOTED(PLUGIN_SUFFIX, "$PLUGIN_SUFFIX", [Suffix for plugins])
AS_IF([test x"$PLUGIN_SUFFIX" != x""], [
	AC_SUBST(USE_SRCS_PLUGINS, '${SRCS_PLUGINS}')
	AC_SUBST(TESTPLUGIN, "plugin")
	AC_DEFINE(OF_HAVE_PLUGINS, 1, [Whether we have plugin support])
])

AC_MSG_CHECKING(whether we need -D_GNU_SOURCE)
AC_EGREP_CPP(yes, [
	#include <stdlib.h>

	#if defined(__GLIBC__) || defined(__MINGW32__)
	yes
	#endif
], [
	CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
	AC_MSG_RESULT(yes)
], [
	AC_MSG_RESULT(no)
])

case "$host_os" in
	solaris*)
		CPPFLAGS="-D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS $CPPFLAGS"
		;;
esac

objc_runtime="ObjFW runtime"

Modified src/OFDate.m from [f24e945ba2] to [e749446c20].

616
617
618
619
620
621
622
623

624
625
626
627
628
629
630
631
632
633
634
635
616
617
618
619
620
621
622

623
624
625
626
627
628
629
630
631
632
633
634
635







-
+












}

- (of_time_interval_t)timeIntervalSinceNow
{
	struct timeval t;
	of_time_interval_t seconds;

	OF_ENSURE(!gettimeofday(&t, NULL));
	OF_ENSURE(gettimeofday(&t, NULL) == 0);

	seconds = t.tv_sec;
	seconds += (of_time_interval_t)t.tv_usec / 1000000;

	return _seconds - seconds;
}

- (OFDate*)dateByAddingTimeInterval: (of_time_interval_t)seconds
{
	return [OFDate dateWithTimeIntervalSince1970: _seconds + seconds];
}
@end