Skip to content

Commit 23b3060

Browse files
Merge pull request #24 from dreamer-coding/fix_stream_macros
Add wrappers for the standard input, output, and error streams
2 parents 1a33617 + 30a2b1f commit 23b3060

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

code/logic/fossil/io/stream.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
#include <stdio.h>
1818
#include <stdint.h>
1919

20-
#define FOSSIL_STDIN stdin
21-
#define FOSSIL_STDOUT stdout
22-
#define FOSSIL_STDERR stderr
23-
2420
#ifdef __cplusplus
2521
extern "C" {
2622
#endif
@@ -33,6 +29,14 @@ typedef struct {
3329
char filename[500]; // Array to store the filename
3430
} fossil_fstream_t;
3531

32+
extern fossil_fstream_t *FOSSIL_STDIN;
33+
extern fossil_fstream_t *FOSSIL_STDOUT;
34+
extern fossil_fstream_t *FOSSIL_STDERR;
35+
36+
#define FOSSIL_STDIN (FOSSIL_STDIN)
37+
#define FOSSIL_STDOUT (FOSSIL_STDOUT)
38+
#define FOSSIL_STDERR (FOSSIL_STDERR)
39+
3640
/**
3741
* Reopen a stream with a new file.
3842
*

0 commit comments

Comments
 (0)