@@ -108,11 +108,15 @@ extern "C" {
108
108
#define funlockfile orig_funlockfile
109
109
#define ftrylockfile orig_ftrylockfile
110
110
111
+ #ifdef __linux
111
112
#define stdin orig_stdin
112
113
#define stdout orig_stdout
113
114
#define stderr orig_stderr
114
115
#endif
116
+ #endif
117
+ #ifdef __linux
115
118
#define _BITS_STDIO_H
119
+ #endif
116
120
#include <stdio.h>
117
121
#include <fcntl.h>
118
122
#ifdef _WIN32
@@ -194,9 +198,11 @@ extern "C" {
194
198
#undef flockfile
195
199
#undef funlockfile
196
200
#undef ftrylockfile
201
+ #ifdef __linux
197
202
#undef stdin
198
203
#undef stdout
199
204
#undef stderr
205
+ #endif
200
206
201
207
#endif
202
208
@@ -270,10 +276,12 @@ typedef struct EFILE_S EFILE;
270
276
#endif
271
277
272
278
NP_DECL (EFILE * ) np_fopen (const char * file , const char * mode );
273
- NP_DECL (int ) np_open (const char * pathname , int flags , mode_t mode );
274
279
#ifdef _WIN32
280
+ NP_DECL (int ) np_open (const char * pathname , int flags , int mode );
275
281
NP_DECL (EFILE * ) np_wfopen (const wchar_t * wfile , const wchar_t * mode );
276
- NP_DECL (int ) np_wopen (const wchar_t * pathname , int flags , mode_t mode );
282
+ NP_DECL (int ) np_wopen (const wchar_t * pathname , int flags , int mode );
283
+ #else
284
+ NP_DECL (int ) np_open (const char * pathname , int flags , mode_t mode );
277
285
#endif
278
286
NP_DECL (int ) np_fclose (void * e );
279
287
NP_DECL (int ) np_close (int fd );
@@ -416,10 +424,12 @@ NP_DECL(int) np_ftrylockfile(void *e);
416
424
// Preprocessor Translation
417
425
#define FILE EFILE
418
426
427
+ #ifdef __linux
419
428
/* Standard streams. */
420
429
extern EFILE * stdin ; /* Standard input stream. */
421
430
extern EFILE * stdout ; /* Standard output stream. */
422
431
extern EFILE * stderr ; /* Standard error output stream. */
432
+ #endif
423
433
424
434
/* File Opening and Closing */
425
435
ALWAYS_INLINE NP_DECL (EFILE * ) fopen (const char * file , const char * mode ) {
0 commit comments