ObjFW  Check-in [26971c2ea9]

Overview
Comment:Make the readdir_r check an AC_TRY_COMPILE check

glibc recently deprecated readdir_r(). However, AC_CHECK_FUNC only
checks for the symbol, which is still there. This would then result in a
warning during compilation (resulting in an error due to -Werror) as
soon as readdir_r() is used.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 26971c2ea97e28b942683cf034732bddb85770063e7368bc1e67680dd51acc6b
User & Date: js on 2016-12-21 16:22:25
Other Links: manifest | tags
Context
2016-12-25
00:53
Use -Werror=deprecated for the readdir_r check check-in: c74cbb9d07 user: js tags: trunk
2016-12-21
16:22
Make the readdir_r check an AC_TRY_COMPILE check check-in: 26971c2ea9 user: js tags: trunk
2016-10-16
20:01
OFBlocks: Forward stack block to copy when copied check-in: 9dc0755178 user: js tags: trunk
Changes

Modified configure.ac from [8a76db0974] to [e8faf65212].

844
845
846
847
848
849
850
851
















852
853
854
855
856
857
858
844
845
846
847
848
849
850

851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873







-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







	])
	AC_CHECK_FUNC(symlink, [
		AC_DEFINE(OF_HAVE_SYMLINK, 1, [Whether we have symlink()])
	])
	AC_CHECK_FUNC(readlink, [
		AC_DEFINE(OF_HAVE_READLINK, 1, [Whether we have readlink()])
	])
	AC_CHECK_FUNCS([lstat readdir_r])
	AC_CHECK_FUNCS([lstat])

	AC_MSG_CHECKING(for readdir_r)
	AC_TRY_COMPILE([
		#include <dirent.h>
	], [
		DIR *dir = 0;
		struct dirent entry, *result;

		readdir_r(dir, &entry, &result);
	], [
		AC_MSG_RESULT(yes)
		AC_DEFINE(HAVE_READDIR_R, 1, [Whether we have readdir_r()])
	], [
		AC_MSG_RESULT(no)
	])
])

AC_CHECK_FUNCS([sysconf gmtime_r localtime_r nanosleep fcntl])

AC_CHECK_FUNC(pipe, [
	AC_DEFINE(OF_HAVE_PIPE, 1, [Whether we have pipe()])
])