summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2017-08-28 13:59:26 -0700
committerGitHub <noreply@github.com>2017-08-28 13:59:26 -0700
commit447a4b1ecd5655357c9daaace03b91355d2e2c6d (patch)
tree46ca08a93e9870aab4fbb533843f3c99796cbdf4 /windows
parent4e63d55d8d0df6d7600bb684fa90a8cb54708ba8 (diff)
parentc679c80c710fd4a0e37ad87200d8a721e19727aa (diff)
Merge pull request #208 from adafruit/merge-v1.9.2
Merge MicroPython v1.9.2
Diffstat (limited to 'windows')
-rw-r--r--windows/Makefile6
-rw-r--r--windows/fmode.h7
-rw-r--r--windows/init.c2
-rw-r--r--windows/init.h6
-rw-r--r--windows/mpconfigport.h12
-rw-r--r--windows/msvc/dirent.h4
-rw-r--r--windows/msvc/gettimeofday.c4
-rw-r--r--windows/msvc/sys/time.h6
-rw-r--r--windows/msvc/unistd.h6
-rw-r--r--windows/realpath.c2
-rw-r--r--windows/realpath.h6
-rw-r--r--windows/sleep.c4
-rw-r--r--windows/sleep.h6
-rw-r--r--windows/windows_mphal.c2
-rw-r--r--windows/windows_mphal.h2
15 files changed, 49 insertions, 26 deletions
diff --git a/windows/Makefile b/windows/Makefile
index 72c97381b..a39d34826 100644
--- a/windows/Makefile
+++ b/windows/Makefile
@@ -8,10 +8,10 @@ PROG = micropython.exe
QSTR_DEFS = ../unix/qstrdefsport.h
# include py core make definitions
-include ../py/py.mk
+include $(TOP)/py/py.mk
INC += -I.
-INC += -I..
+INC += -I$(TOP)
INC += -I$(BUILD)
# compiler settings
@@ -62,4 +62,4 @@ SRC_QSTR += $(SRC_C)
# SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
-include ../py/mkrules.mk
+include $(TOP)/py/mkrules.mk
diff --git a/windows/fmode.h b/windows/fmode.h
index 23d6d3d54..c661c84d0 100644
--- a/windows/fmode.h
+++ b/windows/fmode.h
@@ -23,9 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-
-#ifndef __MICROPY_INCLUDED_WINDOWS_FMODE_H__
-#define __MICROPY_INCLUDED_WINDOWS_FMODE_H__
+#ifndef MICROPY_INCLUDED_WINDOWS_FMODE_H
+#define MICROPY_INCLUDED_WINDOWS_FMODE_H
// Treat files opened by open() as binary. No line ending translation is done.
void set_fmode_binary(void);
@@ -35,4 +34,4 @@ void set_fmode_binary(void);
// When writing to the file \n will be converted into \r\n.
void set_fmode_text(void);
-#endif
+#endif // MICROPY_INCLUDED_WINDOWS_FMODE_H
diff --git a/windows/init.c b/windows/init.c
index 669092347..09fa10417 100644
--- a/windows/init.c
+++ b/windows/init.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
diff --git a/windows/init.h b/windows/init.h
index 69e577689..c6fddb257 100644
--- a/windows/init.h
+++ b/windows/init.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -23,6 +23,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef MICROPY_INCLUDED_WINDOWS_INIT_H
+#define MICROPY_INCLUDED_WINDOWS_INIT_H
void init(void);
void deinit(void);
+
+#endif // MICROPY_INCLUDED_WINDOWS_INIT_H
diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h
index f2f6cbd32..abad35282 100644
--- a/windows/mpconfigport.h
+++ b/windows/mpconfigport.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-// options to control how Micro Python is built
+// options to control how MicroPython is built
// Linking with GNU readline (MICROPY_USE_READLINE == 2) causes binary to be licensed under GPL
#ifndef MICROPY_USE_READLINE
@@ -164,14 +164,14 @@ void mp_hal_dupterm_tx_strn(const char *str, size_t len);
#endif
#define MICROPY_PORT_BUILTINS \
- { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
+ { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
extern const struct _mp_obj_module_t mp_module_os;
extern const struct _mp_obj_module_t mp_module_time;
#define MICROPY_PORT_BUILTIN_MODULES \
- { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&mp_module_time }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_umachine), (mp_obj_t)&mp_module_machine }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&mp_module_os }, \
+ { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_time) }, \
+ { MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, \
+ { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_os) }, \
#if MICROPY_USE_READLINE == 1
#define MICROPY_PORT_ROOT_POINTERS \
diff --git a/windows/msvc/dirent.h b/windows/msvc/dirent.h
index 6172913ee..fca06785a 100644
--- a/windows/msvc/dirent.h
+++ b/windows/msvc/dirent.h
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H
+#define MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H
// dirent.h implementation for msvc
@@ -42,3 +44,5 @@ typedef struct dirent {
DIR *opendir(const char *name);
int closedir(DIR *dir);
struct dirent *readdir(DIR *dir);
+
+#endif // MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H
diff --git a/windows/msvc/gettimeofday.c b/windows/msvc/gettimeofday.c
index 363d59d7b..5f816df70 100644
--- a/windows/msvc/gettimeofday.c
+++ b/windows/msvc/gettimeofday.c
@@ -1,5 +1,5 @@
/*
-* This file is part of the Micro Python project, http://micropython.org/
+* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -43,7 +43,7 @@ int gettimeofday(struct timeval *tp, struct timezone *tz) {
// to microseconds
ft.tm /= 10;
-
+
// convert to unix format
// number of microseconds intervals between the 1st january 1601 and the 1st january 1970 (369 years + 89 leap days)
const unsigned __int64 deltaEpoch = 11644473600000000ull;
diff --git a/windows/msvc/sys/time.h b/windows/msvc/sys/time.h
index 96bca1ccb..7c95d409e 100644
--- a/windows/msvc/sys/time.h
+++ b/windows/msvc/sys/time.h
@@ -1,5 +1,5 @@
/*
-* This file is part of the Micro Python project, http://micropython.org/
+* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -23,6 +23,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H
+#define MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H
// Get the definitions for timeval etc
#include <Winsock2.h>
+
+#endif // MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H
diff --git a/windows/msvc/unistd.h b/windows/msvc/unistd.h
index add10c884..1a1629be4 100644
--- a/windows/msvc/unistd.h
+++ b/windows/msvc/unistd.h
@@ -1,5 +1,5 @@
/*
-* This file is part of the Micro Python project, http://micropython.org/
+* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H
+#define MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H
// There's no unistd.h, but this is the equivalent
#include <io.h>
@@ -38,3 +40,5 @@
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0
+
+#endif // MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H
diff --git a/windows/realpath.c b/windows/realpath.c
index c0ed6b84d..ac9adf812 100644
--- a/windows/realpath.c
+++ b/windows/realpath.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
diff --git a/windows/realpath.h b/windows/realpath.h
index 6f0a29a7e..869fe80fa 100644
--- a/windows/realpath.h
+++ b/windows/realpath.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -23,5 +23,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef MICROPY_INCLUDED_WINDOWS_REALPATH_H
+#define MICROPY_INCLUDED_WINDOWS_REALPATH_H
extern char *realpath(const char *path, char *resolved_path);
+
+#endif // MICROPY_INCLUDED_WINDOWS_REALPATH_H
diff --git a/windows/sleep.c b/windows/sleep.c
index 214d6d622..6043ec7b7 100644
--- a/windows/sleep.c
+++ b/windows/sleep.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -31,7 +31,7 @@
HANDLE waitTimer = NULL;
void init_sleep(void) {
- waitTimer = CreateWaitableTimer(NULL, TRUE, NULL);
+ waitTimer = CreateWaitableTimer(NULL, TRUE, NULL);
}
void deinit_sleep(void) {
diff --git a/windows/sleep.h b/windows/sleep.h
index 09ad4afdc..430ec3a43 100644
--- a/windows/sleep.h
+++ b/windows/sleep.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef MICROPY_INCLUDED_WINDOWS_SLEEP_H
+#define MICROPY_INCLUDED_WINDOWS_SLEEP_H
void init_sleep(void);
void deinit_sleep(void);
@@ -30,3 +32,5 @@ void msec_sleep(double msec);
#ifdef _MSC_VER
int usleep(__int64 usec);
#endif
+
+#endif // MICROPY_INCLUDED_WINDOWS_SLEEP_H
diff --git a/windows/windows_mphal.c b/windows/windows_mphal.c
index a73140e54..153b04423 100644
--- a/windows/windows_mphal.c
+++ b/windows/windows_mphal.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
diff --git a/windows/windows_mphal.h b/windows/windows_mphal.h
index 854e14a7a..5a93d4e18 100644
--- a/windows/windows_mphal.h
+++ b/windows/windows_mphal.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*