diff options
author | Pavol Rusnak <stick@gk2.sk> | 2017-03-31 02:21:18 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-03-31 13:18:47 +1100 |
commit | 6e6c01b97189a95b59a037fa7dabcf8217f199af (patch) | |
tree | 808fbc586f65e1da9bc0f7da6d7f3b3e27ca4da0 /unix/mpconfigport.h | |
parent | 2460888c7403748dc665e3bb5d2e1a321ded4a35 (diff) |
unix: Convert mp_uint_t to size_t in alloc.c.
Diffstat (limited to 'unix/mpconfigport.h')
-rw-r--r-- | unix/mpconfigport.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 66de0fa96..a85884594 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -217,6 +217,9 @@ extern const struct _mp_obj_module_t mp_module_jni; // type definitions for the specific machine +// For size_t and ssize_t +#include <unistd.h> + // assume that if we already defined the obj repr then we also defined types #ifndef MICROPY_OBJ_REPR #ifdef __LP64__ @@ -239,8 +242,8 @@ typedef long long mp_off_t; typedef long mp_off_t; #endif -void mp_unix_alloc_exec(mp_uint_t min_size, void** ptr, mp_uint_t *size); -void mp_unix_free_exec(void *ptr, mp_uint_t size); +void mp_unix_alloc_exec(size_t min_size, void** ptr, size_t *size); +void mp_unix_free_exec(void *ptr, size_t size); void mp_unix_mark_exec(void); #define MP_PLAT_ALLOC_EXEC(min_size, ptr, size) mp_unix_alloc_exec(min_size, ptr, size) #define MP_PLAT_FREE_EXEC(ptr, size) mp_unix_free_exec(ptr, size) @@ -253,7 +256,6 @@ void mp_unix_mark_exec(void); #if MICROPY_PY_OS_DUPTERM #define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len) #else -#include <unistd.h> #define MP_PLAT_PRINT_STRN(str, len) do { ssize_t ret = write(1, str, len); (void)ret; } while (0) #endif |