mpconfigport.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * This file is part of the MicroPython project, http://micropython.org/
  3. *
  4. * The MIT License (MIT)
  5. *
  6. * Copyright (c) 2013-2015 Damien P. George
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. */
  26. // options to control how MicroPython is built
  27. #define MICROPY_ALLOC_PATH_MAX (PATH_MAX)
  28. #define MICROPY_PERSISTENT_CODE_LOAD (0)
  29. #define MICROPY_PERSISTENT_CODE_SAVE (1)
  30. #define MICROPY_EMIT_X64 (0)
  31. #define MICROPY_EMIT_X86 (0)
  32. #define MICROPY_EMIT_THUMB (0)
  33. #define MICROPY_EMIT_INLINE_THUMB (0)
  34. #define MICROPY_EMIT_INLINE_THUMB_ARMV7M (0)
  35. #define MICROPY_EMIT_INLINE_THUMB_FLOAT (0)
  36. #define MICROPY_EMIT_ARM (0)
  37. #define MICROPY_DYNAMIC_COMPILER (1)
  38. #define MICROPY_COMP_CONST_FOLDING (1)
  39. #define MICROPY_COMP_MODULE_CONST (1)
  40. #define MICROPY_COMP_CONST (1)
  41. #define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1)
  42. #define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
  43. #define MICROPY_COMP_RETURN_IF_EXPR (1)
  44. #define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
  45. #define MICROPY_READER_POSIX (1)
  46. #define MICROPY_ENABLE_RUNTIME (0)
  47. #define MICROPY_ENABLE_GC (1)
  48. #define MICROPY_STACK_CHECK (1)
  49. #define MICROPY_HELPER_LEXER_UNIX (1)
  50. #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
  51. #define MICROPY_ENABLE_SOURCE_LINE (1)
  52. #define MICROPY_ENABLE_DOC_STRING (0)
  53. #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
  54. #define MICROPY_WARNINGS (1)
  55. #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
  56. #define MICROPY_CPYTHON_COMPAT (1)
  57. #define MICROPY_USE_INTERNAL_PRINTF (0)
  58. #define MICROPY_PY_BUILTINS_STR_UNICODE (1)
  59. // Define to 1 to use undertested inefficient GC helper implementation
  60. // (if more efficient arch-specific one is not available).
  61. #ifndef MICROPY_GCREGS_SETJMP
  62. #ifdef __mips__
  63. #define MICROPY_GCREGS_SETJMP (1)
  64. #else
  65. #define MICROPY_GCREGS_SETJMP (0)
  66. #endif
  67. #endif
  68. #define MICROPY_PY___FILE__ (0)
  69. #define MICROPY_PY_ARRAY (0)
  70. #define MICROPY_PY_ATTRTUPLE (0)
  71. #define MICROPY_PY_COLLECTIONS (0)
  72. #define MICROPY_PY_MATH (0)
  73. #define MICROPY_PY_CMATH (0)
  74. #define MICROPY_PY_GC (0)
  75. #define MICROPY_PY_IO (0)
  76. #define MICROPY_PY_SYS (0)
  77. // type definitions for the specific machine
  78. #ifdef __LP64__
  79. typedef long mp_int_t; // must be pointer size
  80. typedef unsigned long mp_uint_t; // must be pointer size
  81. #elif defined ( __MINGW32__ ) && defined( _WIN64 )
  82. #include <stdint.h>
  83. typedef __int64 mp_int_t;
  84. typedef unsigned __int64 mp_uint_t;
  85. #else
  86. // These are definitions for machines where sizeof(int) == sizeof(void*),
  87. // regardless for actual size.
  88. typedef int mp_int_t; // must be pointer size
  89. typedef unsigned int mp_uint_t; // must be pointer size
  90. #endif
  91. // Cannot include <sys/types.h>, as it may lead to symbol name clashes
  92. #if _FILE_OFFSET_BITS == 64 && !defined(__LP64__)
  93. typedef long long mp_off_t;
  94. #else
  95. typedef long mp_off_t;
  96. #endif
  97. #define MP_PLAT_PRINT_STRN(str, len) (void)0
  98. #ifndef MP_NOINLINE
  99. #define MP_NOINLINE __attribute__((noinline))
  100. #endif
  101. // We need to provide a declaration/definition of alloca()
  102. #ifdef __FreeBSD__
  103. #include <stdlib.h>
  104. #elif defined( _WIN32 )
  105. #include <malloc.h>
  106. #else
  107. #include <alloca.h>
  108. #endif
  109. #include <stdint.h>