summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2013-09-24 05:43:23 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2013-09-24 05:43:23 (GMT)
commit5f8b28962af100bd244e624c4600e4ac40a15c48 (patch)
tree86fa32758aac8604bf26b7ab10845ed541cec0d8
parentb54c2a5958b12875dc5a32cc1f09da20e23b087d (diff)
downloadtcl-win32_arm.zip
tcl-win32_arm.tar.gz
tcl-win32_arm.tar.bz2
Support compiling Tcl for Win32 on ARM.win32_arm
-rw-r--r--generic/tclPanic.c2
-rw-r--r--win/makefile.vc11
-rw-r--r--win/tclWin32Dll.c4
-rw-r--r--win/tclWinFile.c2
-rw-r--r--win/tclWinSock.c3
5 files changed, 14 insertions, 8 deletions
diff --git a/generic/tclPanic.c b/generic/tclPanic.c
index 2a453b9..4b5752d 100644
--- a/generic/tclPanic.c
+++ b/generic/tclPanic.c
@@ -111,7 +111,7 @@ Tcl_PanicVA(
__builtin_trap();
# elif defined(_WIN64)
__debugbreak();
-# elif defined(_MSC_VER)
+# elif defined(_MSC_VER) && defined (_M_IX86)
_asm {int 3}
# else
DebugBreak();
diff --git a/win/makefile.vc b/win/makefile.vc
index cddb253..02b6010 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -121,7 +121,7 @@ the build instructions.
# nodep = Turns off compatability macros to ensure the core
# isn't being built with deprecated functions.
#
-# MACHINE=(ALPHA|AMD64|IA64|IX86)
+# MACHINE=(ARM|AMD64|IA64|X86)
# Set the machine type used for the compiler, linker, and
# resource compiler. This hook is needed to tell the tools
# when alternate platforms are requested. IX86 is the default
@@ -483,9 +483,16 @@ cdebug = -Zi -Od $(DEBUGFLAGS)
cdebug = -Zi -WX $(DEBUGFLAGS)
!endif
+### Common compiler options that are architecture specific
+!if "$(MACHINE)" == "ARM"
+carch = -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
+!else
+carch =
+!endif
+
### Declarations common to all compiler options
cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
-cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\
+cflags = -nologo -c $(COMPILERFLAGS) $(carch) $(cwarn) -Fp$(TMP_DIR)^\
!if $(MSVCRT)
!if $(DEBUG) && !$(UNCHECKED)
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 0d3b683..c5649c2 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -46,7 +46,7 @@ typedef struct EXCEPTION_REGISTRATION {
* VC++ 5.x has no 'cpuid' assembler instruction, so we must emulate it
*/
-#if defined(_MSC_VER) && (_MSC_VER <= 1100)
+#if defined(_MSC_VER) && (_MSC_VER <= 1100) && defined (_M_IX86)
#define cpuid __asm __emit 0fh __asm __emit 0a2h
#endif
@@ -752,7 +752,7 @@ TclWinCPUID(
__cpuid(regsPtr, index);
status = TCL_OK;
-# else
+# elif defined (_M_IX86)
/*
* Define a structure in the stack frame to hold the registers.
*/
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index f69ad23..dbc961c 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -823,7 +823,7 @@ tclWinDebugPanic(
__builtin_trap();
#elif defined(_WIN64)
__debugbreak();
-#elif defined(_MSC_VER)
+#elif defined(_MSC_VER) && defined (_M_IX86)
_asm {int 3}
#else
DebugBreak();
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index f4d5a90..3253cb8 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -2205,8 +2205,7 @@ TcpGetOptionProc(
flags |= NI_NUMERICHOST;
}
} else if (sockname.sa.sa_family == AF_INET6) {
- if ((IN6_ARE_ADDR_EQUAL(&sockname.sa6.sin6_addr,
- &in6addr_any)) ||
+ if (IN6_IS_ADDR_UNSPECIFIED(&sockname.sa6.sin6_addr) ||
(IN6_IS_ADDR_V4MAPPED(&sockname.sa6.sin6_addr)
&& sockname.sa6.sin6_addr.s6_addr[12] == 0
&& sockname.sa6.sin6_addr.s6_addr[13] == 0