summaryrefslogtreecommitdiffstats
path: root/win/tclWin32Dll.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-12-21 10:04:59 (GMT)
committernijtmans <nijtmans>2010-12-21 10:04:59 (GMT)
commit009a146e6edc065f4e9d015ad84a40a14c5a870f (patch)
tree211ee33fd76e54ca8390071e3eaee209faf27d67 /win/tclWin32Dll.c
parent6a13179e95dfeab6345ab7891e9fc329ccd9e002 (diff)
downloadtcl-009a146e6edc065f4e9d015ad84a40a14c5a870f.zip
tcl-009a146e6edc065f4e9d015ad84a40a14c5a870f.tar.gz
tcl-009a146e6edc065f4e9d015ad84a40a14c5a870f.tar.bz2
[Patch 3059922]: fixes for mingw64 - gcc4.5.1 tdm64-1: completed for all environments.
Diffstat (limited to 'win/tclWin32Dll.c')
-rw-r--r--win/tclWin32Dll.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 1f06703..ac4a008 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -10,10 +10,13 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWin32Dll.c,v 1.72 2010/12/19 18:14:47 nijtmans Exp $
+ * RCS: @(#) $Id: tclWin32Dll.c,v 1.73 2010/12/21 10:04:59 nijtmans Exp $
*/
#include "tclWinInt.h"
+#if defined(HAVE_INTRIN_H) || (defined(_MSC_VER) && defined(_WIN64))
+# include <intrin.h>
+#endif
/*
* The following data structures are used when loading the thunking library
@@ -720,7 +723,12 @@ TclWinCPUID(
{
int status = TCL_ERROR;
-#if defined(__GNUC__)
+#if defined(HAVE_INTRIN_H) && defined(_WIN64)
+
+ __cpuid(regsPtr, index);
+ status = TCL_OK;
+
+#elif defined(__GNUC__)
# if defined(_WIN64)
/*
* Execute the CPUID instruction with the given index, and store results
@@ -836,7 +844,13 @@ TclWinCPUID(
status = registration.status;
# endif /* !_WIN64 */
-#elif defined(_MSC_VER) && !defined(_WIN64)
+#elif defined(_MSC_VER)
+# if defined(_WIN64)
+
+ __cpuid(regsPtr, index);
+ status = TCL_OK;
+
+# else
/*
* Define a structure in the stack frame to hold the registers.
*/
@@ -883,6 +897,7 @@ TclWinCPUID(
/* do nothing */
}
+# endif
#else
/*
* Don't know how to do assembly code for this compiler and/or