diff options
| author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2013-12-30 03:38:32 +0200 | 
|---|---|---|
| committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2013-12-30 03:38:32 +0200 | 
| commit | e85c38992da1f62fc07ee8e203ea98a221857b59 (patch) | |
| tree | 8b7dae173caa4b9063d6d35569946280a7082261 /unix | |
| parent | 732407f1bf12364375162e8fb73816532a5d139c (diff) | |
Make "unix" target be crossplatform and support x86, x64, ARM hosts.
Diffstat (limited to 'unix')
| -rw-r--r-- | unix/Makefile | 5 | ||||
| -rw-r--r-- | unix/mpconfig.h | 18 | 
2 files changed, 20 insertions, 3 deletions
| diff --git a/unix/Makefile b/unix/Makefile index 91e26e524..91d05a2ec 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -9,7 +9,9 @@ SRC_C = \  	main.c \  PY_O = \ +	nlrx86.o \  	nlrx64.o \ +	nlrthumb.o \  	malloc.o \  	qstr.o \  	vstr.o \ @@ -73,6 +75,9 @@ $(BUILD)/%.o: %.c  $(BUILD)/%.o: $(PYSRC)/%.s  	$(AS) -o $@ $< +$(BUILD)/%.o: $(PYSRC)/%.S +	$(CC) $(CFLAGS) -c -o $@ $< +  $(BUILD)/%.o: $(PYSRC)/%.c mpconfig.h  	$(CC) $(CFLAGS) -c -o $@ $< diff --git a/unix/mpconfig.h b/unix/mpconfig.h index a358d7db8..3d0dc8a56 100644 --- a/unix/mpconfig.h +++ b/unix/mpconfig.h @@ -8,10 +8,22 @@  // type definitions for the specific machine -#define BYTES_PER_WORD (8) +#ifdef __LP64__ +typedef long machine_int_t; // must be pointer size +typedef unsigned long machine_uint_t; // must be pointer size +#define UINT_FMT "%lu" +#define INT_FMT "%ld" +#else +// These are definitions for machines where sizeof(int) == sizeof(void*), +// regardless for actual size. +typedef int machine_int_t; // must be pointer size +typedef unsigned int machine_uint_t; // must be pointer size +#define UINT_FMT "%u" +#define INT_FMT "%d" +#endif + +#define BYTES_PER_WORD sizeof(machine_int_t) -typedef int64_t machine_int_t; // must be pointer size -typedef uint64_t machine_uint_t; // must be pointer size  typedef void *machine_ptr_t; // must be of pointer size  typedef const void *machine_const_ptr_t; // must be of pointer size  typedef double machine_float_t; | 
