diff --git a/.gitignore b/.gitignore index d73f353..9eb231e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ docs/ MrC/ testing/ +build-msvc/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 16b1130..dd7c4cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,9 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") add_compile_options(-g -Wall -Wno-unknown-pragmas -Wno-multichar) elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - + add_compile_options(/wd4996 /wd4068) + include_directories(winclude) + set(HAVE_ENDIAN_H 1) endif() diff --git a/bin/main.cpp b/bin/main.cpp index fc40481..fa70ba0 100644 --- a/bin/main.cpp +++ b/bin/main.cpp @@ -328,6 +328,9 @@ void help() printf(" --memory-stats print memory usage information\n"); printf(" --ram= set the ram size. Default=16M\n"); printf(" --stack= set the stack size. Default=8K\n"); +#ifdef ENABLE_DEBUGGER + printf(" --debugger Enable debug shell\n"); +#endif printf("\n"); } diff --git a/config.h.in b/config.h.in index 4ad4887..368959b 100644 --- a/config.h.in +++ b/config.h.in @@ -14,4 +14,9 @@ #cmakedefine HAVE_SYS_ENDIAN_H #cmakedefine HAVE_BSD_STRING_H + +#ifdef _WIN32 +typedef long ssize_t; +#endif + #endif diff --git a/cpu/CMakeLists.txt b/cpu/CMakeLists.txt index b99b93a..226e8ad 100644 --- a/cpu/CMakeLists.txt +++ b/cpu/CMakeLists.txt @@ -1,4 +1,7 @@ +if (MSVC) +else() add_compile_options(-g -Wall -Wno-unused-function) +endif() set(CPU_SRC CpuModule.c diff --git a/winclude/endian.h b/winclude/endian.h new file mode 100644 index 0000000..2af9fa2 --- /dev/null +++ b/winclude/endian.h @@ -0,0 +1,11 @@ +#ifndef __winclude_endian_h__ +#define __winclude_endian_h__ + +#include + +# define LITTLE_ENDIAN 1234 +# define BIG_ENDIAN 4321 +# define PDP_ENDIAN 3412 +# define BYTE_ORDER LITTLE_ENDIAN + +#endif diff --git a/winclude/strings.h b/winclude/strings.h new file mode 100644 index 0000000..e69de29 diff --git a/winclude/unistd.h b/winclude/unistd.h new file mode 100644 index 0000000..ed1ddbc --- /dev/null +++ b/winclude/unistd.h @@ -0,0 +1,10 @@ +#ifndef __winclude_unistd_h__ +#define __winclude_unistd_h__ + +#include + +#define ftruncate(a,b) chsize(a,b) + +typedef long ssize_t; + +#endif