]>
git.saurik.com Git - bison.git/blob - lib/unlocked-io.h
2 # define UNLOCKED_IO_H 1
4 # ifndef USE_UNLOCKED_IO
5 # define USE_UNLOCKED_IO 1
10 /* These are wrappers for functions/macros from GNU libc.
11 The standard I/O functions are thread-safe. These *_unlocked ones are
12 more efficient but not thread-safe. That they're not thread-safe is
13 fine since all of the applications in this package are single threaded. */
15 # if HAVE_DECL_CLEARERR_UNLOCKED
17 # define clearerr(x) clearerr_unlocked (x)
19 # if HAVE_DECL_FEOF_UNLOCKED
21 # define feof(x) feof_unlocked (x)
23 # if HAVE_DECL_FERROR_UNLOCKED
25 # define ferror(x) ferror_unlocked (x)
27 # if HAVE_DECL_FFLUSH_UNLOCKED
29 # define fflush(x) fflush_unlocked (x)
31 # if HAVE_DECL_FGETS_UNLOCKED
33 # define fgets(x,y,z) fgets_unlocked (x,y,z)
35 # if HAVE_DECL_FPUTC_UNLOCKED
37 # define fputc(x,y) fputc_unlocked (x,y)
39 # if HAVE_DECL_FPUTS_UNLOCKED
41 # define fputs(x,y) fputs_unlocked (x,y)
43 # if HAVE_DECL_FREAD_UNLOCKED
45 # define fread(w,x,y,z) fread_unlocked (w,x,y,z)
47 # if HAVE_DECL_FWRITE_UNLOCKED
49 # define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
51 # if HAVE_DECL_GETC_UNLOCKED
53 # define getc(x) getc_unlocked (x)
55 # if HAVE_DECL_GETCHAR_UNLOCKED
57 # define getchar() getchar_unlocked ()
59 # if HAVE_DECL_PUTC_UNLOCKED
61 # define putc(x,y) putc_unlocked (x,y)
63 # if HAVE_DECL_PUTCHAR_UNLOCKED
65 # define putchar(x) putchar_unlocked (x)
68 # endif /* USE_UNLOCKED_IO */
69 #endif /* UNLOCKED_IO_H */