summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-04 01:57:00 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-04 01:57:00 +0200
commitc90c0f68a2f1ee8563497a5380a16e71d18d702a (patch)
treebc79d91a7804a5259f368a86e3f21289e636c4ab /py/mpconfig.h
parentb7aa72710ee6798c6d2bc2632be24206e526fc1e (diff)
downloadmicropython-c90c0f68a2f1ee8563497a5380a16e71d18d702a.tar.gz
micropython-c90c0f68a2f1ee8563497a5380a16e71d18d702a.zip
Move INT_FMT, etc. declaration into global mpconfig.h .
This in particular makes it available for stm port.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 17c5a770c4..44095bd10b 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -4,6 +4,20 @@
#include <mpconfigport.h>
+#ifndef INT_FMT
+// printf format spec to use for machine_int_t and friends
+#ifdef __LP64__
+// Archs where machine_int_t == long, long != int
+#define UINT_FMT "%lu"
+#define INT_FMT "%ld"
+#else
+// Archs where machine_int_t == int
+#define UINT_FMT "%u"
+#define INT_FMT "%d"
+#endif
+#endif //INT_FMT
+
+
// Any options not explicitly set in mpconfigport.h will get default
// values below.