summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile5
-rw-r--r--unix/modos.c2
-rw-r--r--unix/modtime.c6
-rw-r--r--unix/mpconfigport.h1
4 files changed, 8 insertions, 6 deletions
diff --git a/unix/Makefile b/unix/Makefile
index ffc3391a14..485009135f 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -48,7 +48,10 @@ ifeq ($(MICROPY_PY_FFI),1)
LIBFFI_LDFLAGS_MOD := $(shell pkg-config --libs libffi)
LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi)
CFLAGS_MOD += $(LIBFFI_CFLAGS_MOD) -DMICROPY_PY_FFI=1
-LDFLAGS_MOD += -ldl $(LIBFFI_LDFLAGS_MOD)
+ifeq ($(UNAME_S),Linux)
+LDFLAGS_MOD += -ldl
+endif
+LDFLAGS_MOD += $(LIBFFI_LDFLAGS_MOD)
SRC_MOD += modffi.c
endif
diff --git a/unix/modos.c b/unix/modos.c
index a6be4bfff0..657958d04c 100644
--- a/unix/modos.c
+++ b/unix/modos.c
@@ -52,7 +52,7 @@ STATIC mp_obj_t mod_os_stat(mp_obj_t path_in) {
mp_obj_tuple_t *t = mp_obj_new_tuple(10, NULL);
t->items[0] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_mode);
- t->items[1] = MP_OBJ_NEW_SMALL_INT(sb.st_ino);
+ t->items[1] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_ino);
t->items[2] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_dev);
t->items[3] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_nlink);
t->items[4] = MP_OBJ_NEW_SMALL_INT((machine_int_t)sb.st_uid);
diff --git a/unix/modtime.c b/unix/modtime.c
index f957b96784..3cc09e3cd8 100644
--- a/unix/modtime.c
+++ b/unix/modtime.c
@@ -55,10 +55,8 @@ void msec_sleep_tv(struct timeval *tv) {
#define MP_CLOCKS_PER_SEC CLOCKS_PER_SEC
#endif
-#if defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000000) // POSIX
-#define CLOCK_DIV 1000.0
-#elif defined(MP_CLOCKS_PER_SEC) && (MP_CLOCKS_PER_SEC == 1000) // WIN32
-#define CLOCK_DIV 1.0
+#if defined(MP_CLOCKS_PER_SEC)
+#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0)
#else
#error Unsupported clock() implementation
#endif
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index fe68b99341..f6cef8578c 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -43,6 +43,7 @@
#define MICROPY_OPT_COMPUTED_GOTO (1)
#define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_SYS_EXIT (1)
+#define MICROPY_PY_SYS_PLATFORM "linux"
#define MICROPY_PY_SYS_STDFILES (1)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_IO_FILEIO (1)