diff options
author | Nicholas Clark <nick@ccl4.org> | 2000-10-23 16:39:32 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-24 18:59:48 +0000 |
commit | a7ffa9b9a1a8caeff31a83d25b70b5aca6ba0d12 (patch) | |
tree | 43180689a571f5dc8ed050ed33678a7d835c73b6 /perlsdio.h | |
parent | 1724fb8e7df982f0fd79fb192e0146e474675132 (diff) | |
download | perl-a7ffa9b9a1a8caeff31a83d25b70b5aca6ba0d12.tar.gz |
Check if stdio supports tweaking lval and cnt simultaneously.
Subject: PATCH (Re: PerlIO - Configure tweak for Linux/glibc?)
Message-ID: <20001023153932.A10786@plum.flirble.org>
p4raw-id: //depot/perl@7427
Diffstat (limited to 'perlsdio.h')
-rw-r--r-- | perlsdio.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/perlsdio.h b/perlsdio.h index c4a1179a41..90ca5345fb 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -97,20 +97,30 @@ #ifdef STDIO_CNT_LVALUE #define PerlIO_canset_cnt(f) 1 +#define PerlIO_set_cnt(f,c) (FILE_cnt(f) = (c)) #ifdef STDIO_PTR_LVALUE +#ifdef STDIO_PTR_LVAL_NOCHANGE_CNT #define PerlIO_fast_gets(f) 1 #endif -#define PerlIO_set_cnt(f,c) (FILE_cnt(f) = (c)) -#else +#endif /* STDIO_PTR_LVALUE */ +#else /* STDIO_CNT_LVALUE */ #define PerlIO_canset_cnt(f) 0 #define PerlIO_set_cnt(f,c) abort() #endif #ifdef STDIO_PTR_LVALUE -#define PerlIO_set_ptrcnt(f,p,c) (FILE_ptr(f) = (p), PerlIO_set_cnt(f,c)) +#ifdef STDIO_PTR_LVAL_NOCHANGE_CNT +#define PerlIO_set_ptrcnt(f,p,c) STMT_START {FILE_ptr(f) = (p), PerlIO_set_cnt(f,c)} STMT_END +#else +#ifdef STDIO_PTR_LVAL_SETS_CNT +/* assert() may pre-process to ""; potential syntax error (FILE_ptr(), ) */ +#define PerlIO_set_ptrcnt(f,p,c) STMT_START {FILE_ptr(f) = (p); assert(FILE_cnt(f) == (c))} STMT_END +#define PerlIO_fast_gets(f) 1 #else #define PerlIO_set_ptrcnt(f,p,c) abort() #endif +#endif +#endif #else /* USE_STDIO_PTR */ |