ObjFW  Check-in [15365e62aa]

Overview
Comment:Fix pthread_attr_setinheritsched check

* The header was wrong due to still thinking about the check I improved
previously.
* It needs -Werror to not work with an implicit declaration.
* It must not use NULL as an argument, because the parameter could be
declared nonnull.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 15365e62aa03cf119f8b365b79a9badabd62341fd630e5fcd808476aed78b6fa
User & Date: js on 2022-12-29 15:35:39
Other Links: manifest | tags
Context
2022-12-30
00:02
configure: Include package URL check-in: e91657d46b user: js tags: trunk
2022-12-29
15:35
Fix pthread_attr_setinheritsched check check-in: 15365e62aa user: js tags: trunk
15:12
Consider TMPDIR for temporary directory IRI check-in: 915d45a586 user: js tags: trunk
Changes

Modified configure.ac from [1d8ffdf904] to [d7854aceb5].

1039
1040
1041
1042
1043
1044
1045


1046
1047
1048
1049
1050
1051

1052
1053
1054
1055
1056
1057
1058
1059

1060
1061
1062
1063
1064
1065
1066
		AC_CHECK_FUNC(sched_yield, [
			AC_DEFINE(OF_HAVE_SCHED_YIELD, 1,
				[Whether we have sched_yield()])
		])

		AC_CHECK_FUNCS(pthread_attr_getschedpolicy)



		AC_MSG_CHECKING(for pthread_attr_setinheritsched)
		AC_COMPILE_IFELSE([
			AC_LANG_PROGRAM([
				#include <spawn.h>
			], [
				pthread_attr_setinheritsched(NULL, 0);

			])
		], [
			AC_MSG_RESULT(yes)
			AC_DEFINE(HAVE_PTHREAD_ATTR_SETINHERITSCHED, 1,
				[Whether we have pthread_attr_setinheritsched])
		], [
			AC_MSG_RESULT(no)
		])


		AC_CHECK_HEADERS(pthread_np.h, [], [], [#include <pthread.h>])
		AC_CHECK_FUNCS(pthread_set_name_np pthread_setname_np, break)
		;;
	esac

	AC_DEFINE(OF_HAVE_THREADS, 1, [Whether we have threads])







>
>



|

|
>








>







1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
		AC_CHECK_FUNC(sched_yield, [
			AC_DEFINE(OF_HAVE_SCHED_YIELD, 1,
				[Whether we have sched_yield()])
		])

		AC_CHECK_FUNCS(pthread_attr_getschedpolicy)

		old_OBJCFLAGS="$OBJCFLAGS"
		OBJCFLAGS="$OBJCFLAGS -Werror"
		AC_MSG_CHECKING(for pthread_attr_setinheritsched)
		AC_COMPILE_IFELSE([
			AC_LANG_PROGRAM([
				#include <pthread.h>
			], [
				pthread_attr_setinheritsched(
				    (pthread_attr_t *)-1, 0);
			])
		], [
			AC_MSG_RESULT(yes)
			AC_DEFINE(HAVE_PTHREAD_ATTR_SETINHERITSCHED, 1,
				[Whether we have pthread_attr_setinheritsched])
		], [
			AC_MSG_RESULT(no)
		])
		OBJCFLAGS="$old_OBJCFLAGS"

		AC_CHECK_HEADERS(pthread_np.h, [], [], [#include <pthread.h>])
		AC_CHECK_FUNCS(pthread_set_name_np pthread_setname_np, break)
		;;
	esac

	AC_DEFINE(OF_HAVE_THREADS, 1, [Whether we have threads])