ObjFW  Check-in [0348b9b3b3]

Overview
Comment:Check floating point endianess.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0348b9b3b34673c8cf1880bcf98e33bd898a79c1720ea1750891a48df96591a2
User & Date: js on 2011-06-05 17:50:57
Other Links: manifest | tags
Context
2011-06-05
18:07
Add methods for byte swapping floats and doubles. check-in: 2be6a03c5a user: js tags: trunk
17:50
Check floating point endianess. check-in: 0348b9b3b3 user: js tags: trunk
2011-06-04
18:49
Fix a bug in -[OFDictionary initWithKeys:arguments:]. check-in: 50457cd1fd user: js tags: trunk
Changes

Modified configure.ac from [0fb16c8957] to [d47674644f].

211
212
213
214
215
216
217

218



















219
220
221
222
223
224
225
		AC_SUBST(MACH_ALIAS_LIST,
			 ["-Xarch_x86_64 -Wl,-alias_list,mach_alias_list"])
		;;
esac

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

	AC_SUBST(ENDIANESS_DEF, "-DOF_BIG_ENDIAN")



















])

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








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







211
212
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
		AC_SUBST(MACH_ALIAS_LIST,
			 ["-Xarch_x86_64 -Wl,-alias_list,mach_alias_list"])
		;;
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>

Modified src/objfw-defs.h.in from [cbf8d3b793] to [5f2f5a13db].

1
2
3

4
5
6
7
8
9
10
#undef OF_APPLE_RUNTIME
#undef OF_ATOMIC_OPS
#undef OF_BIG_ENDIAN

#undef OF_GNU_RUNTIME
#undef OF_HAVE_ASPRINTF
#undef OF_HAVE_BLOCKS
#undef OF_HAVE_FAST_ENUMERATION
#undef OF_HAVE_GCC_ATOMIC_OPS
#undef OF_HAVE_OPTIONAL_PROTOCOLS
#undef OF_HAVE_OSATOMIC



>







1
2
3
4
5
6
7
8
9
10
11
#undef OF_APPLE_RUNTIME
#undef OF_ATOMIC_OPS
#undef OF_BIG_ENDIAN
#undef OF_FLOAT_BIG_ENDIAN
#undef OF_GNU_RUNTIME
#undef OF_HAVE_ASPRINTF
#undef OF_HAVE_BLOCKS
#undef OF_HAVE_FAST_ENUMERATION
#undef OF_HAVE_GCC_ATOMIC_OPS
#undef OF_HAVE_OPTIONAL_PROTOCOLS
#undef OF_HAVE_OSATOMIC