summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-03-13 00:44:22 (GMT)
committersebres <sebres@users.sourceforge.net>2019-03-13 00:44:22 (GMT)
commit285ce5081201ca01d3178610b345bac6b73b30cd (patch)
treec32a1187526bcbdcfd64343546b7f80656740e37 /win
parenta71097f27c2d2ea02e0c57b8d0473cf88a29febe (diff)
parentdf5dff900864760f02f1b93de275b401a5505f0e (diff)
downloadtcl-285ce5081201ca01d3178610b345bac6b73b30cd.zip
tcl-285ce5081201ca01d3178610b345bac6b73b30cd.tar.gz
tcl-285ce5081201ca01d3178610b345bac6b73b30cd.tar.bz2
merge 8.6
Diffstat (limited to 'win')
-rw-r--r--win/makefile.vc8
-rw-r--r--win/nmakehlp.c14
-rw-r--r--win/rules.vc56
-rwxr-xr-xwin/tclWinFile.c10
-rw-r--r--win/tclWinLoad.c2
-rw-r--r--win/tclWinTest.c2
-rw-r--r--win/tclWinTime.c22
7 files changed, 83 insertions, 31 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index 753d4bb..5df356e 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -381,6 +381,9 @@ dlls: setup $(TCLREGLIB) $(TCLDDELIB)
all: setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) pkgs
tcltest: setup $(TCLTEST) dlls $(CAT32)
install: install-binaries install-libraries install-docs install-pkgs
+!if $(SYMBOLS)
+install: install-pdbs
+!endif
setup: default-setup
test: test-core test-pkgs
@@ -915,6 +918,11 @@ install-msgs:
@$(TCLSH_NATIVE) "$(ROOT:\=/)/tools/installData.tcl" \
"$(ROOT:\=/)/library/msgs" "$(SCRIPT_INSTALL_DIR)/msgs"
+install-pdbs:
+ @echo Installing debug symbols
+ @$(CPY) "$(OUT_DIR)\*.pdb" "$(BIN_INSTALL_DIR)\"
+# "emacs font-lock highlighting fix
+
#---------------------------------------------------------------------
# Clean up
#---------------------------------------------------------------------
diff --git a/win/nmakehlp.c b/win/nmakehlp.c
index b759020..c21de63 100644
--- a/win/nmakehlp.c
+++ b/win/nmakehlp.c
@@ -686,10 +686,10 @@ SubstituteFile(
BOOL FileExists(LPCTSTR szPath)
{
#ifndef INVALID_FILE_ATTRIBUTES
- #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
+ #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif
DWORD pathAttr = GetFileAttributes(szPath);
- return (pathAttr != INVALID_FILE_ATTRIBUTES &&
+ return (pathAttr != INVALID_FILE_ATTRIBUTES &&
!(pathAttr & FILE_ATTRIBUTE_DIRECTORY));
}
@@ -740,7 +740,7 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
#if 0 /* This function is not available in Visual C++ 6 */
/*
* Use numerics 0 -> FindExInfoStandard,
- * 1 -> FindExSearchLimitToDirectories,
+ * 1 -> FindExSearchLimitToDirectories,
* as these are not defined in Visual C++ 6
*/
hSearch = FindFirstFileEx(path, 0, &finfo, 1, NULL, 0);
@@ -755,7 +755,7 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
do {
int sublen;
/*
- * We need to check it is a directory despite the
+ * We need to check it is a directory despite the
* FindExSearchLimitToDirectories in the above call. See SDK docs
*/
if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -786,15 +786,15 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
* that is used to confirm it is the correct directory.
* The search path for the package directory is currently only
* the parent and grandparent of the current working directory.
- * If found, the command prints
+ * If found, the command prints
* name_DIRPATH=<full path of located directory>
* and returns 0. If not found, does not print anything and returns 1.
*/
static int LocateDependency(const char *keypath)
{
int i, ret;
- static char *paths[] = {"..", "..\\..", "..\\..\\.."};
-
+ static const char *paths[] = {"..", "..\\..", "..\\..\\.."};
+
for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) {
ret = LocateDependencyHelper(paths[i], keypath);
if (ret == 0)
diff --git a/win/rules.vc b/win/rules.vc
index 8db4752..485a0f7 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -24,7 +24,7 @@ _RULES_VC = 1
# For modifications that are not backward-compatible, you *must* change
# the major version.
RULES_VERSION_MAJOR = 1
-RULES_VERSION_MINOR = 2
+RULES_VERSION_MINOR = 3
# The PROJECT macro must be defined by parent makefile.
!if "$(PROJECT)" == ""
@@ -475,6 +475,21 @@ MACHINE = AMD64
MACHINE=$(ARCH)
!endif
+#---------------------------------------------------------------
+# The PLATFORM_IDENTIFY macro matches the values returned by
+# the Tcl platform::identify command
+!if "$(MACHINE)" == "AMD64"
+PLATFORM_IDENTIFY = win32-x86_64
+!else
+PLATFORM_IDENTIFY = win32-ix86
+!endif
+
+# The MULTIPLATFORM macro controls whether binary extensions are installed
+# in platform-specific directories. Intended to be set/used by extensions.
+!ifndef MULTIPLATFORM_INSTALL
+MULTIPLATFORM_INSTALL = 0
+!endif
+
#------------------------------------------------------------
# Figure out the *host* architecture by reading the registry
@@ -739,6 +754,8 @@ TCL_THREADS = 1
USE_THREAD_ALLOC= 1
!endif
+# Yes, it's weird that the "symbols" option controls DEBUG and
+# the "pdbs" option controls SYMBOLS. That's historical.
!if [nmakehlp -f $(OPTS) "symbols"]
!message *** Doing symbols
DEBUG = 1
@@ -1226,8 +1243,13 @@ INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include
!else # extension other than Tk
PRJ_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION)
+!if $(MULTIPLATFORM_INSTALL)
+LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR)\$(PLATFORM_IDENTIFY)
+BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR)\$(PLATFORM_IDENTIFY)
+!else
LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR)
BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR)
+!endif
DOC_INSTALL_DIR = $(PRJ_INSTALL_DIR)
SCRIPT_INSTALL_DIR = $(PRJ_INSTALL_DIR)
DEMO_INSTALL_DIR = $(PRJ_INSTALL_DIR)\demos
@@ -1513,9 +1535,15 @@ DEFAULT_BUILD_TARGET = $(PROJECT)
default-target: $(DEFAULT_BUILD_TARGET)
+!if $(MULTIPLATFORM_INSTALL)
+default-pkgindex:
+ @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \
+ [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME)]] > $(OUT_DIR)\pkgIndex.tcl
+!else
default-pkgindex:
@echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \
[list load [file join $$dir $(PRJLIBNAME)]] > $(OUT_DIR)\pkgIndex.tcl
+!endif
default-pkgindex-tea:
@if exist $(ROOT)\pkgIndex.tcl.in nmakehlp -s << $(ROOT)\pkgIndex.tcl.in > $(OUT_DIR)\pkgIndex.tcl
@@ -1525,15 +1553,26 @@ default-pkgindex-tea:
@PKG_LIB_FILE@ $(PRJLIBNAME)
<<
-
default-install: default-install-binaries default-install-libraries
+!if $(SYMBOLS)
+default-install: default-install-pdbs
+!endif
+# Again to deal with historical brokenness, there is some confusion
+# in terminlogy. For extensions, the "install-binaries" was used to
+# locate target directory for *binary shared libraries* and thus
+# the appropriate macro is LIB_INSTALL_DIR since BIN_INSTALL_DIR is
+# for executables (exes). On the other hand the "install-libraries"
+# target is for *scripts* and should have been called "install-scripts".
default-install-binaries: $(PRJLIB)
- @echo Installing binaries to '$(SCRIPT_INSTALL_DIR)'
- @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)"
- @$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL
+ @echo Installing binaries to '$(LIB_INSTALL_DIR)'
+ @if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)"
+ @$(CPY) $(PRJLIB) "$(LIB_INSTALL_DIR)" >NUL
-default-install-libraries: $(OUT_DIR)\pkgIndex.tcl
+# Alias for default-install-scripts
+default-install-libraries: default-install-scripts
+
+default-install-scripts: $(OUT_DIR)\pkgIndex.tcl
@echo Installing libraries to '$(SCRIPT_INSTALL_DIR)'
@if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)"
@echo Installing package index in '$(SCRIPT_INSTALL_DIR)'
@@ -1544,6 +1583,11 @@ default-install-stubs:
@if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)"
@$(CPY) $(PRJSTUBLIB) "$(SCRIPT_INSTALL_DIR)" >NUL
+default-install-pdbs:
+ @echo Installing PDBs to '$(LIB_INSTALL_DIR)'
+ @if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)"
+ @$(CPY) "$(OUT_DIR)\*.pdb" "$(LIB_INSTALL_DIR)\"
+
default-install-docs-html:
@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
@if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)"
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index b9787c7..809bcf0 100755
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1460,9 +1460,9 @@ TclpGetUserHome(
domain = Tcl_UtfFindFirst(name, '@');
if (domain == NULL) {
const char *ptr;
-
+
/* no domain - firstly check it's the current user */
- if ( (ptr = TclpGetUserName(&ds)) != NULL
+ if ( (ptr = TclpGetUserName(&ds)) != NULL
&& strcasecmp(name, ptr) == 0
) {
/* try safest and fastest way to get current user home */
@@ -1485,7 +1485,7 @@ TclpGetUserHome(
Tcl_DStringInit(&ds);
wName = Tcl_UtfToUniCharDString(name, nameLen, &ds);
while (NetUserGetInfo(wDomain, wName, 1, (LPBYTE *) &uiPtr) != 0) {
- /*
+ /*
* user does not exists - if domain was not specified,
* try again using current domain.
*/
@@ -1600,7 +1600,7 @@ NativeAccess(
return 0;
}
- /*
+ /*
* If it's not a directory (assume file), do several fast checks:
*/
if (!(attr & FILE_ATTRIBUTE_DIRECTORY)) {
@@ -2031,7 +2031,7 @@ NativeStat(
*/
fileHandle = CreateFile(nativePath, GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL);
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index 2946ea2..69263e9 100644
--- a/win/tclWinLoad.c
+++ b/win/tclWinLoad.c
@@ -88,7 +88,7 @@ TclpDlopen(
Tcl_DString ds;
- /*
+ /*
* Remember the first error on load attempt to be used if the
* second load attempt below also fails.
*/
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index aa2c15a..30fc4b4 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -572,7 +572,7 @@ TestplatformChmod(
*/
if (set_readOnly == acl_readOnly_found || SetNamedSecurityInfoA(
- (LPSTR) nativePath, SE_FILE_OBJECT,
+ (LPSTR) nativePath, SE_FILE_OBJECT,
DACL_SECURITY_INFORMATION /*| PROTECTED_DACL_SECURITY_INFORMATION*/,
NULL, NULL, newAcl, NULL) == ERROR_SUCCESS) {
res = 0;
diff --git a/win/tclWinTime.c b/win/tclWinTime.c
index d4e84ba..77924ee 100644
--- a/win/tclWinTime.c
+++ b/win/tclWinTime.c
@@ -257,7 +257,7 @@ TclpGetWideClicks(void)
/*
* The frequency of the performance counter is fixed at system boot and
- * is consistent across all processors. Therefore, the frequency need
+ * is consistent across all processors. Therefore, the frequency need
* only be queried upon application initialization.
*/
if (QueryPerformanceFrequency(&perfCounterFreq)) {
@@ -268,7 +268,7 @@ TclpGetWideClicks(void)
wideClick.perfCounter = 0;
wideClick.microsecsScale = 1;
}
-
+
wideClick.initialized = 1;
}
if (wideClick.perfCounter) {
@@ -289,7 +289,7 @@ TclpGetWideClicks(void)
*
* TclpWideClickInMicrosec --
*
- * This procedure return scale to convert wide click values from the
+ * This procedure return scale to convert wide click values from the
* TclpGetWideClicks native resolution to microsecond resolution
* and back.
*
@@ -328,7 +328,7 @@ TclpWideClickInMicrosec(void)
*----------------------------------------------------------------------
*/
-Tcl_WideInt
+Tcl_WideInt
TclpGetMicroseconds(void)
{
Tcl_WideInt usecSincePosixEpoch;
@@ -447,7 +447,7 @@ NativeCalc100NsTicks(
LONGLONG curCounterFreq,
LONGLONG curCounter
) {
- return fileTimeLastCall +
+ return fileTimeLastCall +
((curCounter - perfCounterLastCall) * 10000000 / curCounterFreq);
}
@@ -1065,7 +1065,7 @@ UpdateTimeEachSecond(void)
return;
}
QueryPerformanceCounter(&curPerfCounter);
-
+
lastFileTime.QuadPart = curFileTime.QuadPart;
/*
@@ -1133,7 +1133,7 @@ UpdateTimeEachSecond(void)
/* calculate new frequency and estimate drift to the next second */
vt1 = 20000000 + curFileTime.QuadPart;
driftFreq = (estFreq * 20000000 / (vt1 - vt0));
- /*
+ /*
* Avoid too large drifts (only half of the current difference),
* that allows also be more accurate (aspire to the smallest tdiff),
* so then we can prolong calibration interval by tdiff < 100000
@@ -1141,13 +1141,13 @@ UpdateTimeEachSecond(void)
driftFreq = timeInfo.curCounterFreq.QuadPart +
(driftFreq - timeInfo.curCounterFreq.QuadPart) / 2;
- /*
+ /*
* Average between estimated, 2 current and 5 drifted frequencies,
* (do the soft drifting as possible)
*/
estFreq = (estFreq + 2 * timeInfo.curCounterFreq.QuadPart + 5 * driftFreq) / 8;
}
-
+
/* Avoid too large discrepancy from nominal frequency */
if (estFreq > 1003*timeInfo.nominalFreq.QuadPart/1000) {
estFreq = 1003*timeInfo.nominalFreq.QuadPart/1000;
@@ -1156,9 +1156,9 @@ UpdateTimeEachSecond(void)
estFreq = 997*timeInfo.nominalFreq.QuadPart/1000;
vt0 = curFileTime.QuadPart;
} else if (vt0 != curFileTime.QuadPart) {
- /*
+ /*
* Be sure the clock ticks never backwards (avoid it by negative drifting)
- * just compare native time (in 100-ns) before and hereafter using
+ * just compare native time (in 100-ns) before and hereafter using
* new calibrated values) and do a small adjustment (short time freeze)
*/
LARGE_INTEGER newPerfCounter;