Skip to content

Commit 5e5f999

Browse files
committed
support 64bit target
1 parent 4a7cdca commit 5e5f999

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ File `xc.c` is the original one and `xc-tutor.c` is the one that I make for
66
the tutorial step by step.
77

88
```
9-
gcc -o xc xc.c (you may need the -m32 option on 64bit machines)
9+
gcc -o xc xc.c
1010
./xc hello.c
1111
./xc -s hello.c
1212

xc-tutor.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <stdlib.h>
66
#include <memory.h>
77
#include <string.h>
8+
#define int long long // to work with 64bit address
89

910
int token; // current token
1011
int token_val; // value of current token (mainly for number)
@@ -1251,8 +1252,11 @@ int eval() {
12511252
return 0;
12521253
}
12531254

1255+
#undef int // Mac/clang needs this to compile
1256+
12541257
int main(int argc, char **argv)
12551258
{
1259+
#define int long long // to work with 64bit address
12561260

12571261
int i, fd;
12581262
int *tmp;

xc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <stdlib.h>
33
#include <memory.h>
44
#include <string.h>
5+
#define int long long // to work with 64bit address
56

67
int debug; // print the executed instructions
78
int assembly; // print out the assembly and source
@@ -1276,8 +1277,12 @@ int eval() {
12761277
}
12771278
}
12781279

1280+
#undef int // Mac/clang needs this to compile
1281+
12791282
int main(int argc, char **argv)
12801283
{
1284+
#define int long long // to work with 64bit address
1285+
12811286
int i, fd;
12821287
int *tmp;
12831288

0 commit comments

Comments
 (0)