diff options
-rw-r--r-- | generic/regc_nfa.c | 1 | ||||
-rw-r--r-- | generic/regcomp.c | 3 | ||||
-rw-r--r-- | generic/tclMain.c | 3 | ||||
-rw-r--r-- | generic/tclThread.c | 26 | ||||
-rw-r--r-- | unix/tclUnixFile.c | 7 | ||||
-rw-r--r-- | win/makefile.vc | 7 |
6 files changed, 33 insertions, 14 deletions
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 2de7e14..1d572c3 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -49,6 +49,7 @@ newnfa( nfa = (struct nfa *) MALLOC(sizeof(struct nfa)); if (nfa == NULL) { + ERR(REG_ESPACE); return NULL; } diff --git a/generic/regcomp.c b/generic/regcomp.c index 77f2f20..d23076b 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -982,6 +982,7 @@ parseqatom( NOERR(); assert(v->nextvalue > 0); atom = subre(v, 'b', BACKR, lp, rp); + NOERR(); subno = v->nextvalue; atom->subno = subno; EMPTYARC(lp, rp); /* temporarily, so there's something */ @@ -1129,6 +1130,7 @@ parseqatom( */ t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp); + NOERR(); t->left = atom; atomp = &t->left; @@ -1142,6 +1144,7 @@ parseqatom( assert(top->op == '=' && top->left == NULL && top->right == NULL); top->left = subre(v, '=', top->flags, top->begin, lp); + NOERR(); top->op = '.'; top->right = t; diff --git a/generic/tclMain.c b/generic/tclMain.c index 5e5109b..b2206f8 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -28,7 +28,10 @@ * source directory to make their own modified versions). */ +#if defined _MSC_VER && _MSC_VER < 1900 +/* isatty is always defined on MSVC 14.0, but not necessarily as CRTIMPORT. */ extern CRTIMPORT int isatty(int fd); +#endif static Tcl_Obj *tclStartupScriptPath = NULL; static Tcl_Obj *tclStartupScriptEncoding = NULL; diff --git a/generic/tclThread.c b/generic/tclThread.c index 087d735..17071e5 100644 --- a/generic/tclThread.c +++ b/generic/tclThread.c @@ -24,7 +24,7 @@ typedef struct { int num; /* Number of objects remembered */ int max; /* Max size of the array */ - char **list; /* List of pointers */ + void **list; /* List of pointers */ } SyncObjRecord; static SyncObjRecord keyRecord = {0, 0, NULL}; @@ -35,8 +35,8 @@ static SyncObjRecord condRecord = {0, 0, NULL}; * Prototypes of functions used only in this file. */ -static void ForgetSyncObject(char *objPtr, SyncObjRecord *recPtr); -static void RememberSyncObject(char *objPtr, +static void ForgetSyncObject(void *objPtr, SyncObjRecord *recPtr); +static void RememberSyncObject(void *objPtr, SyncObjRecord *recPtr); /* @@ -94,7 +94,7 @@ Tcl_GetThreadData( result = ckalloc((size_t) size); memset(result, 0, (size_t) size); *keyPtr = (Tcl_ThreadDataKey)result; - RememberSyncObject((char *) keyPtr, &keyRecord); + RememberSyncObject(keyPtr, &keyRecord); } result = * (void **) keyPtr; #endif /* TCL_THREADS */ @@ -153,10 +153,10 @@ TclThreadDataKeyGet( static void RememberSyncObject( - char *objPtr, /* Pointer to sync object */ + void *objPtr, /* Pointer to sync object */ SyncObjRecord *recPtr) /* Record of sync objects */ { - char **newList; + void **newList; int i, j; @@ -178,7 +178,7 @@ RememberSyncObject( if (recPtr->num >= recPtr->max) { recPtr->max += 8; - newList = (char **) ckalloc(recPtr->max * sizeof(char *)); + newList = (void **) ckalloc(recPtr->max * sizeof(char *)); for (i=0,j=0 ; i<recPtr->num ; i++) { if (recPtr->list[i] != NULL) { newList[j++] = recPtr->list[i]; @@ -214,7 +214,7 @@ RememberSyncObject( static void ForgetSyncObject( - char *objPtr, /* Pointer to sync object */ + void *objPtr, /* Pointer to sync object */ SyncObjRecord *recPtr) /* Record of sync objects */ { int i; @@ -248,7 +248,7 @@ void TclRememberMutex( Tcl_Mutex *mutexPtr) { - RememberSyncObject((char *)mutexPtr, &mutexRecord); + RememberSyncObject(mutexPtr, &mutexRecord); } /* @@ -276,7 +276,7 @@ Tcl_MutexFinalize( TclpFinalizeMutex(mutexPtr); #endif TclpMasterLock(); - ForgetSyncObject((char *) mutexPtr, &mutexRecord); + ForgetSyncObject(mutexPtr, &mutexRecord); TclpMasterUnlock(); } @@ -303,7 +303,9 @@ void TclMutexUnlockAndFinalize( Tcl_Mutex *mutexPtr) { +#ifdef TCL_THREADS Tcl_Mutex mutex; +#endif TclpMasterLock(); TclpMutexLock(); #ifdef TCL_THREADS @@ -338,7 +340,7 @@ void TclRememberCondition( Tcl_Condition *condPtr) { - RememberSyncObject((char *) condPtr, &condRecord); + RememberSyncObject(condPtr, &condRecord); } /* @@ -366,7 +368,7 @@ Tcl_ConditionFinalize( TclpFinalizeCondition(condPtr); #endif TclpMasterLock(); - ForgetSyncObject((char *) condPtr, &condRecord); + ForgetSyncObject(condPtr, &condRecord); TclpMasterUnlock(); } diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index c5f75a7..0a2099c 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -155,6 +155,11 @@ TclpFindExecutable( goto done; } + if (TclpGetCwd(NULL, &cwd) == NULL) { + TclSetObjNameOfExecutable(Tcl_NewObj(), NULL); + goto done; + } + /* * The name is relative to the current working directory. First strip off * a leading "./", if any, then add the full path name of the current @@ -168,8 +173,6 @@ TclpFindExecutable( Tcl_DStringInit(&nameString); Tcl_DStringAppend(&nameString, name, -1); - TclpGetCwd(NULL, &cwd); - Tcl_DStringFree(&buffer); Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&cwd), Tcl_DStringLength(&cwd), &buffer); diff --git a/win/makefile.vc b/win/makefile.vc index 1f957ea..267f53f 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -480,6 +480,10 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) lflags = $(lflags) -profile
!endif
+!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
+lflags = $(lflags) -nodefaultlib:libucrt.lib
+!endif
+
!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
### Align sections for PE size savings.
lflags = $(lflags) -opt:nowin98
@@ -504,6 +508,9 @@ baselibs = kernel32.lib user32.lib ws2_32.lib baselibs = $(baselibs) bufferoverflowU.lib
!endif
!endif
+!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
+baselibs = $(baselibs) ucrt.lib
+!endif
#---------------------------------------------------------------------
# TclTest flags
|