ObjFW  Check-in [a6513f3228]

Overview
Comment:Only check if snprintf returns required space if there's no asprintf.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a6513f3228f4217c9f426eac1a6f5ee90b2ac79d58f0aabd1ca54cd84126d959
User & Date: js on 2009-09-21 11:26:53
Other Links: manifest | tags
Context
2009-09-21
20:35
A few minor Win32 fixes. check-in: 59969f5450 user: js tags: trunk
11:26
Only check if snprintf returns required space if there's no asprintf. check-in: a6513f3228 user: js tags: trunk
11:15
Move platform-specific threading stuff to threading.h. check-in: 15a67e8ee5 user: js tags: trunk
Changes

Modified configure.ac from [ba3ce580f0] to [4862f25471].

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

AC_CHECK_FUNC(asprintf, [
	have_asprintf="yes"
	AC_DEFINE(OF_HAVE_ASPRINTF, 1, [Whether we have asprintf])
	AC_SUBST(ASPRINTF_DEF, "-DOF_HAVE_ASPRINTF")
	], [
	have_asprintf="no"
	AC_SUBST(ASPRINTF_C, "asprintf.c")])

AC_MSG_CHECKING(whether snprintf returns something useful)
AC_CACHE_VAL(ac_cv_snprintf_useful_ret, [
	AC_TRY_RUN([
		#include <stdio.h>

		int
		main()
		{
			return (snprintf(NULL, 0, "asd") == 3 ? 0 : 1);
		}],
		ac_cv_snprintf_useful_ret="yes",
		ac_cv_snprintf_useful_ret="no",
		ac_cv_snprintf_useful_ret="no")])
AC_MSG_RESULT($ac_cv_snprintf_useful_ret)

test x"$have_asprintf" != x"yes" -a x"$ac_cv_snprintf_useful_ret" != x"yes" && \
	AC_MSG_ERROR(No asprintf and no snprintf returning required space!)

case "$host" in
	*-*-mingw*)
		AC_MSG_CHECKING(for threads)







|

|
|
|
|

|
|
|
|
|
|
|
|
|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

AC_CHECK_FUNC(asprintf, [
	have_asprintf="yes"
	AC_DEFINE(OF_HAVE_ASPRINTF, 1, [Whether we have asprintf])
	AC_SUBST(ASPRINTF_DEF, "-DOF_HAVE_ASPRINTF")
	], [
	have_asprintf="no"
	AC_SUBST(ASPRINTF_C, "asprintf.c")

	AC_MSG_CHECKING(whether snprintf returns something useful)
	AC_CACHE_VAL(ac_cv_snprintf_useful_ret, [
		AC_TRY_RUN([
			#include <stdio.h>

			int
			main()
			{
				return (snprintf(NULL, 0, "asd") == 3 ? 0 : 1);
			}],
			ac_cv_snprintf_useful_ret="yes",
			ac_cv_snprintf_useful_ret="no",
			ac_cv_snprintf_useful_ret="no")])
		AC_MSG_RESULT($ac_cv_snprintf_useful_ret)])

test x"$have_asprintf" != x"yes" -a x"$ac_cv_snprintf_useful_ret" != x"yes" && \
	AC_MSG_ERROR(No asprintf and no snprintf returning required space!)

case "$host" in
	*-*-mingw*)
		AC_MSG_CHECKING(for threads)