From c1d9e6fa784f00d692c277f4934d2a98bb4644e4 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 6 Nov 2000 22:51:29 +0000 Subject: [PATCH] Make the stdio test program of 7427 less noisy while being compiled so that Digital UNIX wouldn't get both d_stdio_ptr_lval_nochange_cnt and d_stdio_ptr_lval_sets_cnt undefined. This makes perlio happy. p4raw-id: //depot/perl@7581 --- Configure | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Configure b/Configure index 13e52db..c07cf35 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Sun Nov 5 00:37:41 EET 2000 [metaconfig 3.0 PL70] +# Generated on Tue Nov 7 00:26:20 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >/tmp/c1$$ <try.c < /* Can we scream? */ /* Eat dust sed :-) */ -#define FILE_ptr(fp) $stdio_ptr -#define FILE_cnt(fp) $stdio_cnt +/* In the buffer space, no one can hear you scream. */ +#define FILE_ptr(fp) ((fp)->_ptr) +#define FILE_cnt(fp) ((fp)->_cnt) +#include int main() { FILE *fp = fopen("try.c", "r"); - char c = getc(fp); + int c; char *ptr; size_t cnt; + if (!fp) { + puts("Fail even to read"); + exit(1); + } + c = getc(fp); /* Read away the first # */ + if (c == EOF) { + puts("Fail even to read"); + exit(1); + } if (!( 18 <= FILE_cnt(fp) && strncmp(FILE_ptr(fp), "include \n", 18) == 0 @@ -11560,12 +11571,12 @@ int main() { puts("Fail even to read"); exit (1); } - ptr = FILE_ptr(fp); - cnt = FILE_cnt(fp); + ptr = (char*) FILE_ptr(fp); + cnt = (size_t)FILE_cnt(fp); - FILE_ptr(fp)+= 42; + FILE_ptr(fp) += 42; - if (FILE_ptr(fp) != (ptr + 42)) { + if ((char*)FILE_ptr(fp) != (ptr + 42)) { printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42)); exit (1); } -- 2.7.4