X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=x2p%2Fstr.c;h=953a811f501cc3bb9341858c834583a94213ab28;hb=dbc738d943045683f1788bd71a8d8e560c14f6d6;hp=9e9d2da4b86d8f3dd6fefd98168a46afd61a16bc;hpb=16d20bd98cd29be76029ebf04027a7edd34d817b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/x2p/str.c b/x2p/str.c index 9e9d2da..953a811 100644 --- a/x2p/str.c +++ b/x2p/str.c @@ -287,7 +287,8 @@ str_gets(str,fp) register STR *str; register FILE *fp; { -#ifdef USE_STDIO_PTR /* Here is some breathtakingly efficient cheating */ +#if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE) + /* Here is some breathtakingly efficient cheating */ register char *bp; /* we're going to steal some values */ register int cnt; /* from the stdio struct and put EVERYTHING */ @@ -316,7 +317,7 @@ register FILE *fp; FILE_cnt(fp) = cnt; /* deregisterize cnt and ptr */ FILE_ptr(fp) = ptr; - i = _filbuf(fp); /* get more characters */ + i = FILE_filbuf(fp); /* get more characters */ cnt = FILE_cnt(fp); ptr = FILE_ptr(fp); /* reregisterize cnt and ptr */ @@ -339,7 +340,8 @@ thats_all_folks: *bp = '\0'; str->str_cur = bp - str->str_ptr; /* set length */ -#else /* !USE_STDIO_PTR */ /* The big, slow, and stupid way */ +#else /* USE_STDIO_PTR && STDIO_PTR_LVALUE && STDIO_CNT_LVALUE */ + /* The big, slow, and stupid way */ static char buf[4192]; @@ -348,7 +350,7 @@ thats_all_folks: else str_set(str, No); -#endif /* USE_STDIO_PTR */ +#endif /* USE_STDIO_PTR && STDIO_PTR_LVALUE && STDIO_CNT_LVALUE */ return str->str_cur ? str->str_ptr : Nullch; }