Merge jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 07 Mar 2016 08:08:02 +0000
branchjv
changeset 19302 68355697fc84
parent 19281 4d70a3cb95ee (current diff)
parent 19298 cfacc6b159c5 (diff)
child 19303 0f6711342ff1
Merge
ApplicationDefinition.st
Behavior.st
OSProcess.st
Object.st
ObjectMemory.st
Process.st
ProjectDefinition.st
Win32OperatingSystem.st
--- a/ApplicationDefinition.st	Thu Mar 03 09:51:06 2016 +0000
+++ b/ApplicationDefinition.st	Mon Mar 07 08:08:02 2016 +0000
@@ -1765,7 +1765,7 @@
 
 #
 APPNAME=%(LIBRARY_NAME)
-LIBNAME=dummy
+LIBNAME=%(LIBRARY_NAME)
 MODULE_PATH=%(MODULE_PATH)
 STCOPT="+optinline"
 LOCALINCLUDES=%(LOCAL_INCLUDES)
@@ -2007,9 +2007,9 @@
 # ENDMAKEDEPEND --- do not remove this line
 %(ADDITIONAL_RULES_HG)'.
 
-    "Modified: / 22-11-2012 / 17:18:28 / cg"
     "Modified: / 02-06-2015 / 17:40:03 / gg"
     "Modified: / 26-01-2016 / 14:23:35 / jv"
+    "Modified: / 03-03-2016 / 21:15:43 / cg"
 !
 
 bc_dot_mak_app_source_rules
@@ -2861,7 +2861,7 @@
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
 SectionEnd
 
-LangString appOpen ${LANG_GERMAN}  "Mit %(PRODUCT_NAME) öffnen"
+LangString appOpen ${LANG_GERMAN}  "Mit %(PRODUCT_NAME) ffnen"
 LangString appOpen ${LANG_ENGLISH} "Open with %(PRODUCT_NAME)"
 
 LangString DESC_Section1 ${LANG_ENGLISH} "Program components of %(PRODUCT_NAME)"
@@ -2895,7 +2895,7 @@
 
 Function un.onInit
 !!insertmacro MUI_UNGETLANGUAGE
-  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Möchten Sie %(PRODUCT_NAME) und alle seine Komponenten deinstallieren?" IDYES +2
+  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Mchten Sie %(PRODUCT_NAME) und alle seine Komponenten deinstallieren?" IDYES +2
   Abort
 FunctionEnd
 
@@ -2994,15 +2994,17 @@
 !
 
 preRequisiteLine_bc_dot_mak
+    "Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) '
+     is required!!"
     ^
 '%(FILE_NAME).dll: %(MODULE_DIRECTORY)\$(OBJDIR)\%(FILE_NAME).dll
         copy %(MODULE_DIRECTORY)\$(OBJDIR)\%(FILE_NAME).dll *.*
 
 %(MODULE_DIRECTORY)\$(OBJDIR)\%(FILE_NAME).dll: $(FORCE)
-        pushd %(MODULE_DIRECTORY) & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+        pushd %(MODULE_DIRECTORY) & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 '
 
-    "Modified: / 26-07-2010 / 12:26:10 / cg"
+    "Modified: / 03-03-2016 / 21:22:21 / cg"
 !
 
 preRequisiteLine_make_dot_proto
@@ -3029,26 +3031,34 @@
 !
 
 subProjectLine_bc_dot_mak
+    "Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) '
+     is required!!"
+
 ^'%(LIBRARY_NAME).dll: %(PATH_TO_SUB_PROJECT)\$(OBJDIR)\%(LIBRARY_NAME).dll
         copy %(PATH_TO_SUB_PROJECT)\$(OBJDIR)\%(LIBRARY_NAME).dll *.*
 
 %(PATH_TO_SUB_PROJECT)\$(OBJDIR)\%(LIBRARY_NAME).dll:
-        pushd %(PATH_TO_SUB_PROJECT) & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+        pushd %(PATH_TO_SUB_PROJECT) & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 '
 
-    "Modified: / 26-07-2010 / 12:26:01 / cg"
+    "Modified: / 03-03-2016 / 21:23:00 / cg"
 !
 
 subProjectLine_make_dot_proto
+    "Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) '
+     is required!!"
+
 ^'%(LIBRARY_NAME).so: %(PATH_TO_SUB_PROJECT)/%(LIBRARY_NAME).so
         ln -sf %(PATH_TO_SUB_PROJECT)/%(LIBRARY_NAME).so .
 
 %(PATH_TO_SUB_PROJECT)/%(LIBRARY_NAME).so: %(PATH_TO_SUB_PROJECT)/makefile
-        cd %(PATH_TO_SUB_PROJECT) && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+        cd %(PATH_TO_SUB_PROJECT) && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 
 %(PATH_TO_SUB_PROJECT)/makefile: %(PATH_TO_SUB_PROJECT)/Make.proto
         $(TOP)/rules/stmkmf --cd %(PATH_TO_SUB_PROJECT)
 '
+
+    "Modified: / 03-03-2016 / 21:23:10 / cg"
 !
 
 undefineExtenionLine_nsi_for:extension
--- a/OSProcess.st	Thu Mar 03 09:51:06 2016 +0000
+++ b/OSProcess.st	Mon Mar 07 08:08:02 2016 +0000
@@ -1,5 +1,7 @@
 "{ Package: 'stx:libbasic' }"
 
+"{ NameSpace: Smalltalk }"
+
 Object subclass:#OSProcess
 	instanceVariableNames:'pid parentPid commandLine'
 	classVariableNames:''
@@ -32,6 +34,10 @@
 
 !OSProcess methodsFor:'accessing'!
 
+accessor
+    ^ self
+!
+
 commandLine
     ^ commandLine
 !
@@ -56,6 +62,12 @@
     pid := something.
 ! !
 
+!OSProcess methodsFor:'file queries'!
+
+isExecutable:aPathName
+    ^ aPathName asFilename isExecutable
+! !
+
 !OSProcess methodsFor:'printing'!
 
 printOn:aStream
@@ -132,6 +144,11 @@
 
 !OSProcess class methodsFor:'documentation'!
 
+version
+    ^ '$Header$'
+!
+
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/OSProcess.st,v 1.2 2011-03-08 17:01:30 stefan Exp $'
+    ^ '$Header$'
 ! !
+
--- a/Object.st	Thu Mar 03 09:51:06 2016 +0000
+++ b/Object.st	Mon Mar 07 08:08:02 2016 +0000
@@ -520,6 +520,7 @@
 
 
 
+
 !Object methodsFor:'Compatibility-Dolphin'!
 
 stbFixup: anSTBInFiler at: newObjectIndex
@@ -1758,6 +1759,8 @@
     "
 ! !
 
+
+
 !Object methodsFor:'attributes access'!
 
 objectAttributeAt:attributeKey
@@ -1880,6 +1883,7 @@
 ! !
 
 
+
 !Object methodsFor:'change & update'!
 
 broadcast:aSelectorSymbol
@@ -2940,7 +2944,7 @@
     "Modified: / 20-08-2010 / 17:13:06 / cg"
 !
 
-assert:aBooleanOrBlock message:messageIfFailing
+assert:aBooleanOrBlock description:messageIfFailing
     "fail, if the argument does not evaluate to true and report an error"
 
     "{ Pragma: +optSpace }"
@@ -2952,10 +2956,26 @@
 
     "/ could still be a block or false.
     (aBooleanOrBlock value) ifFalse:[
-	AssertionFailedError
-	    raiseRequestWith:self
-	    errorString:(messageIfFailing, ' {',thisContext methodHome sender "methodHome" printString,' }')
-    ].
+        AssertionFailedError
+            raiseRequestWith:self
+            errorString:(messageIfFailing, ' {',thisContext methodHome sender "methodHome" printString,' }')
+    ].
+
+    "
+     self assert:false description:'xxx'
+    "
+
+    "Modified (comment): / 06-03-2012 / 11:26:48 / cg"
+!
+
+assert:aBooleanOrBlock message:messageIfFailing
+    "fail, if the argument does not evaluate to true and report an error"
+
+    "{ Pragma: +optSpace }"
+
+    <resource: #skipInDebuggersWalkBack>
+
+    ^ self assert: aBooleanOrBlock description: messageIfFailing
 
     "
      self assert:false message:'xxx'
@@ -10320,6 +10340,7 @@
 
 
 
+
 !Object class methodsFor:'documentation'!
 
 version
--- a/ObjectMemory.st	Thu Mar 03 09:51:06 2016 +0000
+++ b/ObjectMemory.st	Mon Mar 07 08:08:02 2016 +0000
@@ -1,3 +1,14 @@
+"
+ COPYRIGHT (c) 1992 by Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
 "{ Package: 'stx:libbasic' }"
 
 "{ NameSpace: Smalltalk }"
@@ -1077,6 +1088,15 @@
 
 !ObjectMemory class methodsFor:'cache management'!
 
+debugBreakPoint
+
+%{
+    extern void __debugBreakPoint__();
+    __debugBreakPoint__();
+%}.
+    ^ 0
+!
+
 debugBreakPoint3
 
 %{
--- a/Process.st	Thu Mar 03 09:51:06 2016 +0000
+++ b/Process.st	Mon Mar 07 08:08:02 2016 +0000
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1992 by Claus Gittinger
 	      All Rights Reserved
@@ -14,11 +16,11 @@
 "{ NameSpace: Smalltalk }"
 
 Link subclass:#Process
-	instanceVariableNames:'id lookupActivations lookupDisabled prio state startBlock name restartable
-		interruptActions exitActions suspendSemaphore singleStepping
-		emergencySignalHandler suspendActions creatorId processGroupId
-		interruptsDisabled priorityRange exceptionHandlerSet processType
-		environment'
+	instanceVariableNames:'id lookupActivations lookupDisabled prio state startBlock name
+		restartable interruptActions exitActions suspendSemaphore
+		singleStepping emergencySignalHandler suspendActions creatorId
+		processGroupId interruptsDisabled priorityRange
+		exceptionHandlerSet processType environment'
 	classVariableNames:'TerminateSignal RestartSignal CaughtSignals'
 	poolDictionaries:''
 	category:'Kernel-Processes'
@@ -377,9 +379,10 @@
     "return the default max stack size. All new processes get
      this limit initially.
      It may be changed for individual processes with:
-	aProcess setMaximumStackSize:limit"
+        aProcess setMaximumStackSize:limit"
 
 %{  /* NOCONTEXT */
+    extern INT __defaultThreadMaxStackSize();
 
     RETURN ( __mkSmallInteger( __defaultThreadMaxStackSize() ));
 %}
@@ -395,15 +398,16 @@
     "set the default max stack size, return the previous value.
      All new processes get this stack limit initially.
      It may be changed for individual processes with:
-	aProcess setMaximumStackSize:limit
+        aProcess setMaximumStackSize:limit
      Notice:
-	There is seldom any need to change the default setting,
-	except for highly recursive programs."
+        There is seldom any need to change the default setting,
+        except for highly recursive programs."
 
 %{  /* NOCONTEXT */
+    extern INT __threadSetDefaultMaxStackSize();
 
     if (__isSmallInteger(numberOfBytes)) {
-	RETURN ( __mkSmallInteger(__threadSetDefaultMaxStackSize(__intVal(numberOfBytes)) ));
+        RETURN ( __mkSmallInteger(__threadSetDefaultMaxStackSize(__intVal(numberOfBytes)) ));
     }
 %}
 
@@ -412,6 +416,51 @@
     "
 
     "Modified: 8.5.1996 / 10:23:26 / cg"
+!
+
+wrapStackSize
+    "return the wrap stack size. 
+     Under windows, blocking API calls are executed on a separate stack with this size.
+     If you ever encounter that a call to n external library function requires more stack than
+     this, you may change this size in your startup (or programmatically) during early startup.
+     Returns nil on non-windows machines."
+
+%{  /* NOCONTEXT */
+    INT sz = 0;
+
+#ifdef WIN32
+    extern INT __getWrapStackSize();
+
+    sz = __getWrapStackSize();
+#endif
+    RETURN (__MKINT(sz));
+%}
+!
+
+wrapStackSize:newSize
+    "set the wrap stack size. 
+     Under windows, blocking API calls are executed on a separate stack with this size.
+     If you ever encounter that a call to n external library function requires more stack than
+     this, you may change this size in your startup (or programmatically) during early startup.
+     An argument of 0 changes the size back to the default.
+     Returns the previous size."
+
+%{  /* NOCONTEXT */
+    INT __oldSize = 0;
+
+    if (__isSmallInteger(newSize)) {
+        INT __newSize = __intVal(newSize);
+
+        if (__newSize >= 0) {
+#ifdef WIN32
+            extern INT __setWrapStackSize(INT);
+
+            __oldSize = __setWrapStackSize(__newSize);
+#endif
+        }
+    }
+    RETURN (__MKINT(__oldSize));
+%}
 ! !
 
 !Process class methodsFor:'instance retrieval'!
@@ -477,7 +526,6 @@
     "Created: 15.11.1996 / 11:41:06 / cg"
 ! !
 
-
 !Process methodsFor:'accessing'!
 
 beGUIProcess
@@ -785,11 +833,11 @@
      needs more stack (in bytes) than this number"
 
 %{  /* NOCONTEXT */
-    extern int __threadMaxStackSize();
+    extern INT __threadMaxStackSize();
     OBJ i;
 
     if (__isSmallInteger(i = __INST(id))) {
-	RETURN( __mkSmallInteger(__threadMaxStackSize(__intVal(i))) );
+        RETURN( __MKINT(__threadMaxStackSize(__intVal(i))) );
     }
 %}.
     ^ nil
@@ -802,12 +850,12 @@
      Returns the old value."
 
 %{  /* NOCONTEXT */
-    extern int __threadSetMaxStackSize();
+    extern INT __threadSetMaxStackSize(int, unsigned INT);
     OBJ i;
 
     if (__isSmallInteger(i = __INST(id))
      && __isSmallInteger(limit) ) {
-	RETURN ( __mkSmallInteger(__threadSetMaxStackSize(__intVal(i), __intVal(limit))) );
+        RETURN ( __MKINT(__threadSetMaxStackSize(__intVal(i), __intVal(limit))) );
     }
 %}.
     ^ nil
@@ -818,14 +866,15 @@
      and stackIncrement-parameters. Not for normal use."
 
 %{  /* NOCONTEXT */
-    extern int __threadSetJunkSizes();
+    extern INT __threadSetJunkSizes(int, unsigned INT, unsigned INT, unsigned INT);
+
     OBJ i;
 
     if (__isSmallInteger(i = __INST(id))
      && __isSmallInteger(initial)
      && __isSmallInteger(increment)
      && __isSmallInteger(safe)) {
-	RETURN ( __threadSetJunkSizes(__intVal(i), __intVal(initial), __intVal(increment), __intVal(safe)) ? true : false );
+        RETURN ( __threadSetJunkSizes(__intVal(i), __intVal(initial), __intVal(increment), __intVal(safe)) ? true : false );
     }
 %}.
     ^ false
@@ -1025,14 +1074,14 @@
     "internal monitoring only - will vanish"
 
 %{  /* NOCONTEXT */
-    extern int __threadNumberOfStackBoundaryHits();
-    int n;
+    extern INT __threadNumberOfStackBoundaryHits();
+    INT n;
     OBJ i;
 
     if (__isSmallInteger(i = __INST(id))) {
-	n = __threadNumberOfStackBoundaryHits(__intVal(i));
-	n &= _MAX_INT;
-	RETURN( __mkSmallInteger(n) );
+        n = __threadNumberOfStackBoundaryHits(__intVal(i));
+        n &= _MAX_INT;
+        RETURN( __mkSmallInteger(n) );
     }
 %}.
     ^ nil
@@ -1043,11 +1092,11 @@
      This method is for monitoring purposes only - it may vanish."
 
 %{  /* NOCONTEXT */
-    extern int __threadTotalStackSize();
+    extern int __threadStackSegments();
     OBJ i;
 
     if (__isSmallInteger(i = __INST(id))) {
-	RETURN( __mkSmallInteger((INT)__threadStackSegments(__intVal(i))) );
+        RETURN( __mkSmallInteger((INT)__threadStackSegments(__intVal(i))) );
     }
 %}.
     ^ nil
@@ -1058,11 +1107,11 @@
      This method is for monitoring purposes only - it may vanish."
 
 %{  /* NOCONTEXT */
-    extern int __threadTotalStackSize();
+    extern INT __threadTotalStackSize();
     OBJ i;
 
     if (__isSmallInteger(i = __INST(id))) {
-	RETURN( __mkSmallInteger(__threadTotalStackSize(__intVal(i))) );
+        RETURN( __MKINT(__threadTotalStackSize(__intVal(i))) );
     }
 %}.
     ^ nil
@@ -1077,7 +1126,7 @@
     OBJ i;
 
     if (__isSmallInteger(i = __INST(id))) {
-	RETURN( __mkSmallInteger(__threadUsedStackSize(__intVal(i))) );
+        RETURN( __MKINT(__threadUsedStackSize(__intVal(i))) );
     }
 %}.
     ^ nil
@@ -2047,7 +2096,6 @@
     "Created: 28.10.1996 / 20:44:07 / cg"
 ! !
 
-
 !Process methodsFor:'thread local storage'!
 
 environmentAt:aKey
@@ -2146,9 +2194,12 @@
 
 !Process class methodsFor:'documentation'!
 
+version
+    ^ '$Header$'
+!
+
 version_CVS
-
-    ^ '$Header: /cvs/stx/stx/libbasic/Process.st,v 1.191 2015-04-07 10:52:50 cg Exp $'
+    ^ '$Header$'
 !
 
 version_SVN
--- a/ProjectDefinition.st	Thu Mar 03 09:51:06 2016 +0000
+++ b/ProjectDefinition.st	Mon Mar 07 08:08:02 2016 +0000
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2006 by eXept Software AG
               All Rights Reserved
@@ -4564,7 +4566,7 @@
         "cg: changed to not go and remake librun"
         (self allPreRequisitesSorted:#effectiveMandatoryPreRequisites "#effectivePreRequisites") do:[:projectID |
             libPath := self pathToPackage:projectID withSeparator:'/'.
-            s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"'.
+            s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'.
         ].
 
         s cr.
@@ -4574,6 +4576,8 @@
      exept_expecco_application generateRequiredMakePrerequisites_make_dot_proto
      alspa_batch_application generateRequiredMakePrerequisites_make_dot_proto
     "
+
+    "Modified: / 03-03-2016 / 21:23:31 / cg"
 !
 
 generateRequiredMakeReferences_bc_dot_mak
@@ -4617,7 +4621,7 @@
     ^ String streamContents:[:s |
         preRequisites do:[:projectID |
             libPath := self pathToPackage:projectID withSeparator:'/'.
-            s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"'.
+            s tab; nextPutAll: 'cd ', libPath; nextPutLine:' && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "'.
         ].
 
         s cr.
@@ -4627,6 +4631,8 @@
      exept_expecco_application generateRequiredMakeReferences_make_dot_proto
      alspa_batch_application generateRequiredMakeReferences_make_dot_proto
     "
+
+    "Modified: / 03-03-2016 / 21:23:45 / cg"
 !
 
 generateSubDirectories
--- a/Win32OperatingSystem.st	Thu Mar 03 09:51:06 2016 +0000
+++ b/Win32OperatingSystem.st	Mon Mar 07 08:08:02 2016 +0000
@@ -7910,32 +7910,33 @@
     "get an environment string"
 
 %{  /* NOCONTEXT */
-    WCHAR _varName[1024];
-    WCHAR buff[1024];
+#   define ENV_BUFSIZE 2048
+    WCHAR _varName[ENV_BUFSIZE];
+    WCHAR buff[ENV_BUFSIZE];
     int nNeeded;
     OBJ ret = nil;
     int i, l;
 
     if (__isStringLike(aStringOrSymbol)) {
 	l = __stringSize(aStringOrSymbol);
-	if (l > sizeof(_varName)-1)
+	if (l > ENV_BUFSIZE-1)
 	    goto badArgument;
 	for (i=0; i<l; i++) {
 	    _varName[i] = __stringVal(aStringOrSymbol)[i];
 	}
     } else if (__isUnicode16String(aStringOrSymbol)) {
 	l = __unicode16StringSize(aStringOrSymbol);
-	if (l > sizeof(_varName)-1)
+	if (l > ENV_BUFSIZE-1)
 	    goto badArgument;
 	for (i=0; i<l; i++) {
 	    _varName[i] = __unicode16StringVal(aStringOrSymbol)[i];
 	}
-    } else
+    } else {
 	goto badArgument;
-
+    }
     _varName[l] = 0;
 
-    nNeeded = GetEnvironmentVariableW(_varName, buff, sizeof(buff));
+    nNeeded = GetEnvironmentVariableW(_varName, buff, ENV_BUFSIZE);
     if (nNeeded > sizeof(buff)) {
 	WCHAR *buff2;
 
@@ -7945,6 +7946,7 @@
 	free(buff2);
     } else if (nNeeded > 0) {
 	ret = __mkStringOrU16String_maxlen(buff, nNeeded);
+	// console_printf("getenv() -> %"_lx_"\n", (INT)ret);
     }
     RETURN (ret);
 
@@ -9048,6 +9050,22 @@
     "Created: / 27-10-2012 / 13:59:03 / cg"
 !
 
+isWin10Like
+    "return true, if running on a Windows10 (or newer) like system.
+     (also true for server 2016)"
+
+    |sysInfo major|
+
+    sysInfo := self getSystemInfo.
+    major := sysInfo at:#majorVersion.
+
+    ^ (major >= 10)
+
+    "
+     self isWin10Like
+    "
+!
+
 maxFileNameLength
     "return the max number of characters in a filename.
      CAVEAT: