summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorblmorris <bryan.morrissey@gmail.com>2015-08-03 16:13:34 -0400
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-08-05 21:18:33 +0300
commit26664dd1802615b48ce5f53aa8a00a79353c7ae3 (patch)
treed1ba1a10c6fcbb20fba73470223f025af8ea857d
parent4434e43fa150eee99cc120e97c26ad6b3fa8a15d (diff)
downloadmicropython-26664dd1802615b48ce5f53aa8a00a79353c7ae3.tar.gz
micropython-26664dd1802615b48ce5f53aa8a00a79353c7ae3.zip
unix/mpconfigport.h: set MICROPY_PY_SYS_PLATFORM to "darwin" if compiled on OSX
This change allows micropython to return the same value as CPython for sys.platform
-rw-r--r--unix/mpconfigport.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index a004017797..ccc3d4af2f 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -73,7 +73,11 @@
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
#define MICROPY_PY_SYS_EXIT (1)
-#define MICROPY_PY_SYS_PLATFORM "linux"
+#if defined(__APPLE__) && defined(__MACH__)
+ #define MICROPY_PY_SYS_PLATFORM "darwin"
+#else
+ #define MICROPY_PY_SYS_PLATFORM "linux"
+#endif
#define MICROPY_PY_SYS_MAXSIZE (1)
#define MICROPY_PY_SYS_STDFILES (1)
#define MICROPY_PY_SYS_EXC_INFO (1)