ObjFW  Check-in [c3f475701c]

Overview
Comment:Check size of float and double.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c3f475701ced5a1f09848cfaebfed1fbee1cf312cc0092e74c086aa22fdc113f
User & Date: js on 2011-06-05 18:44:49
Other Links: manifest | tags
Context
2011-06-05
18:53
Rename -[connetToHost:onPort:] to -[connectToHost:port:]. check-in: 1940d72ec7 user: js tags: trunk
18:44
Check size of float and double. check-in: c3f475701c user: js tags: trunk
18:32
Add methods to read / write floats and doubles to OFStream. check-in: f31197a153 user: js tags: trunk
Changes

Modified configure.ac from [d47674644f] to [e128d5eedf].

213
214
215
216
217
218
219






220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237

238
239
240
241
242
243
244
245
246
		;;
esac

AC_C_BIGENDIAN([
	AC_DEFINE(OF_BIG_ENDIAN, 1, [Whether we are big endian])
])







AC_MSG_CHECKING(for floating point endianess)
float_endianess="unknown"
AC_TRY_COMPILE([
	double endianess = 184092775106.859375;
], [
], [
	AS_IF([$EGREP BEndian conftest.$ac_objext >/dev/null], [
		AC_DEFINE(OF_FLOAT_BIG_ENDIAN, 1,
			[Whether floats are big endian])
		float_endianess="big endian"
	], [
		AS_IF([$EGREP naidnEB conftest.$ac_objext >/dev/null], [
			float_endianess="little endian"
		])
	])
])
AC_MSG_RESULT($float_endianess)
AS_IF([test x"$float_endianess" = x"unknown"], [

       AC_MSG_ERROR([FP implementation does not conform to IEEE 754!])
])

AC_MSG_CHECKING(for SIZE_MAX)
AC_EGREP_CPP(yes, [
	#include <stdint.h>
	#include <limits.h>

	#ifdef SIZE_MAX







>
>
>
>
>
>


















>
|
<







213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245

246
247
248
249
250
251
252
		;;
esac

AC_C_BIGENDIAN([
	AC_DEFINE(OF_BIG_ENDIAN, 1, [Whether we are big endian])
])

AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AS_IF([test x"$ac_cv_sizeof_float" != x"4" -o x"$ac_cv_sizeof_double" != x"8"],
	[AC_MSG_ERROR(
		[Floating point implementation does not conform to IEEE 754!])])

AC_MSG_CHECKING(for floating point endianess)
float_endianess="unknown"
AC_TRY_COMPILE([
	double endianess = 184092775106.859375;
], [
], [
	AS_IF([$EGREP BEndian conftest.$ac_objext >/dev/null], [
		AC_DEFINE(OF_FLOAT_BIG_ENDIAN, 1,
			[Whether floats are big endian])
		float_endianess="big endian"
	], [
		AS_IF([$EGREP naidnEB conftest.$ac_objext >/dev/null], [
			float_endianess="little endian"
		])
	])
])
AC_MSG_RESULT($float_endianess)
AS_IF([test x"$float_endianess" = x"unknown"], [
	AC_MSG_ERROR(
		[Floating point implementation does not conform to IEEE 754!])])


AC_MSG_CHECKING(for SIZE_MAX)
AC_EGREP_CPP(yes, [
	#include <stdint.h>
	#include <limits.h>

	#ifdef SIZE_MAX