Skip to content

Commit 9b1b444

Browse files
committed
Ensure that in and out are only defined once.
I'm not actually certain that the #include guard is necessary, but it doesn't hurt.
1 parent 7e8395b commit 9b1b444

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

langs/evildoer/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#include "types.h"
44
#include "runtime.h"
55

6+
FILE* in;
7+
FILE* out;
8+
69
void print_result(int64_t);
710
void print_char(int64_t);
811

langs/evildoer/runtime.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef RUNTIME_H
2+
#define RUNTIME_H
13
int64_t entry();
2-
FILE* in;
3-
FILE* out;
4+
extern FILE* in;
5+
extern FILE* out;
6+
#endif /* RUNTIME_H */

0 commit comments

Comments
 (0)