X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Finternal%2Fstdio_impl.h;h=1127a492d96373d2e5af278ec50a080b49945944;hb=23389b1988b061e8487c316893a8a8eb77770a2f;hp=72c55192727067a84d72d6f85467a0a28839aa5a;hpb=16f18d036d9a7bf590ee6eb86785c0a9658220b6;p=musl diff --git a/src/internal/stdio_impl.h b/src/internal/stdio_impl.h index 72c55192..1127a492 100644 --- a/src/internal/stdio_impl.h +++ b/src/internal/stdio_impl.h @@ -9,7 +9,7 @@ #define FFINALLOCK(f) ((f)->lock>=0 ? __lockfile((f)) : 0) #define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0) -#define FUNLOCK(f) if (__need_unlock) __unlockfile((f)); else +#define FUNLOCK(f) do { if (__need_unlock) __unlockfile((f)); } while (0) #define F_PERM 1 #define F_NORD 4 @@ -76,8 +76,9 @@ int __putc_unlocked(int, FILE *); FILE *__fdopen(int, const char *); int __fmodeflags(const char *); -#define OFLLOCK() LOCK(libc.ofl_lock) -#define OFLUNLOCK() UNLOCK(libc.ofl_lock) +FILE *__ofl_add(FILE *f); +FILE **__ofl_lock(void); +void __ofl_unlock(void); #define feof(f) ((f)->flags & F_EOF) #define ferror(f) ((f)->flags & F_ERR) @@ -85,7 +86,8 @@ int __fmodeflags(const char *); #define getc_unlocked(f) \ ( ((f)->rpos < (f)->rend) ? *(f)->rpos++ : __uflow((f)) ) -#define putc_unlocked(c, f) ( ((c)!=(f)->lbf && (f)->wpos<(f)->wend) \ +#define putc_unlocked(c, f) \ + ( ((unsigned char)(c)!=(f)->lbf && (f)->wpos<(f)->wend) \ ? *(f)->wpos++ = (c) : __overflow((f),(c)) ) /* Caller-allocated FILE * operations */