source: trunk/diffutils/lib/unlocked-io.h@ 2603

Last change on this file since 2603 was 2556, checked in by bird, 20 years ago

diffutils 2.8.1

File size: 1.7 KB
Line 
1#ifndef UNLOCKED_IO_H
2# define UNLOCKED_IO_H 1
3
4# ifndef USE_UNLOCKED_IO
5# define USE_UNLOCKED_IO 1
6# endif
7
8# if USE_UNLOCKED_IO
9
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. */
14
15# if HAVE_DECL_CLEARERR_UNLOCKED
16# undef clearerr
17# define clearerr(x) clearerr_unlocked (x)
18# endif
19# if HAVE_DECL_FEOF_UNLOCKED
20# undef feof
21# define feof(x) feof_unlocked (x)
22# endif
23# if HAVE_DECL_FERROR_UNLOCKED
24# undef ferror
25# define ferror(x) ferror_unlocked (x)
26# endif
27# if HAVE_DECL_FFLUSH_UNLOCKED
28# undef fflush
29# define fflush(x) fflush_unlocked (x)
30# endif
31# if HAVE_DECL_FGETS_UNLOCKED
32# undef fgets
33# define fgets(x,y,z) fgets_unlocked (x,y,z)
34# endif
35# if HAVE_DECL_FPUTC_UNLOCKED
36# undef fputc
37# define fputc(x,y) fputc_unlocked (x,y)
38# endif
39# if HAVE_DECL_FPUTS_UNLOCKED
40# undef fputs
41# define fputs(x,y) fputs_unlocked (x,y)
42# endif
43# if HAVE_DECL_FREAD_UNLOCKED
44# undef fread
45# define fread(w,x,y,z) fread_unlocked (w,x,y,z)
46# endif
47# if HAVE_DECL_FWRITE_UNLOCKED
48# undef fwrite
49# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
50# endif
51# if HAVE_DECL_GETC_UNLOCKED