ObjectFileLoader.st
changeset 3958 5718c550a588
parent 3956 81b8cd7a75ec
child 3959 d31dca1c3ca9
--- a/ObjectFileLoader.st	Fri Aug 26 16:50:34 2016 +0200
+++ b/ObjectFileLoader.st	Tue Aug 30 11:46:08 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -2903,32 +2905,32 @@
 
     fn := pathNameOrFilename asFilename.
     fn exists ifTrue:[
-	pathName := fn pathName.
-	self copyLibrariesWhenLoading ifTrue:[
-	    fn copyTo:(tempFile := ParserFlags stcModulePath asFilename construct:fn baseName).
-	    pathName := tempFile pathName.
-	].
+        pathName := fn pathName.
+        self copyLibrariesWhenLoading ifTrue:[
+            fn copyTo:(tempFile := ParserFlags stcModulePath asFilename construct:fn baseName).
+            pathName := tempFile pathName.
+        ].
     ] ifFalse:[
-	"/ something like "kernel32.dll"; must be along the PATH setting
-	pathName := pathNameOrFilename asString.
+        "/ something like "kernel32.dll"; must be along the PATH setting
+        pathName := pathNameOrFilename asString.
     ].
 
     Verbose ifTrue:[
-	('loadDynamic: ',pathNameOrFilename asString,' (',pathName asString,')...') errorPrintCR
+        ('loadDynamic: ',pathNameOrFilename asString,' (',pathName asString,')...') errorPrintCR
     ].
     encodedPathName := OperatingSystem encodePath:pathName.
 
     "/ already loaded ?
     handle := self handleForDynamicObject:encodedPathName.
     handle notNil ifTrue:[
-	Verbose ifTrue:[
-	    ('... ' , pathName , ' already loaded.') errorPrintCR.
-	].
-	^ handle
+        Verbose ifTrue:[
+            ('... ' , pathName , ' already loaded.') errorPrintCR.
+        ].
+        ^ handle
     ].
 
     Verbose ifTrue:[
-	('initializeLoader...') errorPrintCR
+        ('initializeLoader...') errorPrintCR
     ].
     self initializeLoader.
 
@@ -2942,29 +2944,29 @@
     buffer at:4 put:NextHandleID. NextHandleID := NextHandleID + 1.
 
     Verbose ifTrue:[
-	('primLoadDynamicObject...') errorPrintCR
+        ('primLoadDynamicObject...') errorPrintCR
     ].
 
     buffer := self primLoadDynamicObject:encodedPathName into:buffer.
     Verbose ifTrue:[
-	('done') errorPrintCR
+        ('done') errorPrintCR
     ].
 
     buffer isNil ifTrue:[
-	LastError == #notImplemented ifTrue:[
-	    'ObjectFileLoader [warning]: no dynamic load facility present.' infoPrintCR.
-	] ifFalse:[
-	    LastError == #linkError ifTrue:[
-		LinkErrorMessage notNil ifTrue:[
-		    ('ObjectFileLoader [warning]: load error:' , LinkErrorMessage) infoPrintCR.
-		] ifFalse:[
-		    ('ObjectFileLoader [warning]: load error') infoPrintCR.
-		].
-	    ].
-	].
-	('ObjectFileLoader [warning]: failed to load: ' , pathName) infoPrintCR.
-	Transcript showCR:('ObjectFileLoader [warning]: failed to load: ' , pathName).
-	^ nil
+        LastError == #notImplemented ifTrue:[
+            'ObjectFileLoader [warning]: no dynamic load facility present.' infoPrintCR.
+        ] ifFalse:[
+            LastError == #linkError ifTrue:[
+                LinkErrorMessage notNil ifTrue:[
+                    ('ObjectFileLoader [warning]: load error:' , LinkErrorMessage) infoPrintCR.
+                ] ifFalse:[
+                    ('ObjectFileLoader [warning]: load error') infoPrintCR.
+                ].
+            ].
+        ].
+        ('ObjectFileLoader [warning]: failed to load: ' , pathName) infoPrintCR.
+"/        Transcript showCR:('ObjectFileLoader [warning]: failed to load: ' , pathName).
+        ^ nil
     ].
 
     "
@@ -2977,13 +2979,13 @@
     handle moduleID:(buffer at:4).
 
     LoadedObjects isNil ifTrue:[
-	LoadedObjects := Dictionary new.
+        LoadedObjects := Dictionary new.
     ].
     LoadedObjects at:pathName put:handle.
     "/ Smalltalk flushCachedClasses.
 
     Verbose ifTrue:[
-	('loadDynamic ok; handle is: ' , handle printString) errorPrintCR.
+        ('loadDynamic ok; handle is: ' , handle printString) errorPrintCR.
     ].
     "/ ObjectMemory garbageCollect.