From 9f99c5480d52968b530169b4324738b9c718e791 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 2 Aug 1994 09:41:55 +0000 Subject: [PATCH] fixes to dtrt with ANSI_STDIO; previously there was gratuitous abuse of this particular definition, as it was really just detecting the presence of setvbuf(). Now it does a compile-and-run to check for binary fopen() availability, and the check for setvbuf() has been moved. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4030 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/krb5/ChangeLog | 7 +++++++ src/include/krb5/acconfig.h | 1 + src/include/krb5/configure.in | 18 +++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index 7dae7d2d9..cfbf9bc75 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,10 @@ +Tue Aug 2 03:39:14 1994 Tom Yu (tlyu@dragons-lair) + + * acconfig.h: add HAVE_SETVBUF + + * configure.in: changes to make things saner when checking for + ANSI_STDIO + Thu Jul 14 03:31:06 1994 Tom Yu (tlyu at dragons-lair) * Makefile.in: some cleanup to not echo cruft diff --git a/src/include/krb5/acconfig.h b/src/include/krb5/acconfig.h index 7d84251c5..eaf5ca50d 100644 --- a/src/include/krb5/acconfig.h +++ b/src/include/krb5/acconfig.h @@ -1,6 +1,7 @@ /* just stuff needed by kerberos 5 */ #undef ANSI_STDIO +#undef HAS_SETVBUF #undef BITS32 #undef HAS_ANSI_CONST #undef HAS_ANSI_VOLATILE diff --git a/src/include/krb5/configure.in b/src/include/krb5/configure.in index e6204a181..3b4d5b0cd 100644 --- a/src/include/krb5/configure.in +++ b/src/include/krb5/configure.in @@ -39,9 +39,21 @@ AC_HEADER_CHECK(string.h,AC_DEFINE(USE_STRING_H)) AC_HEADER_CHECK(stdlib.h,AC_DEFINE(HAS_STDLIB_H),AC_DEFINE(NO_STDLIB_H)) CHECK_STDARG -dnl this is misused to *also* mean that "b" is needed to fopen binary... -AC_FUNC_CHECK([setvbuf],AC_DEFINE(ANSI_STDIO)) - +AC_FUNC_CHECK([setvbuf],AC_DEFINE(HAS_SETVBUF)) +dnl check for ANSI stdio, esp "b" option to fopen(). This (unfortunately) +dnl requires a run check... +AC_CHECKING([for ANSI stdio]) +AC_TEST_PROGRAM([ +#include +int main() +{ + FILE *conftest; + if ((conftest = fopen("conftest.dat", "w")) == NULL) exit(1); + if (fclose(conftest)) exit(1); + if ((conftest = fopen("conftest.dat", "rb+")) == NULL) exit(1); + if (fputs("testing ANSI for stdio\n", conftest) == EOF) exit(1); + exit(0); +}],AC_DEFINE(ANSI_STDIO)) AC_COMPILE_CHECK([prototype support], [int x(double y, int z);],,AC_DEFINE(KRB5_PROVIDE_PROTOTYPES)) -- 2.26.2