Skip to content

Commit 8a97e1d

Browse files
committed
DLL/SO for Win/Linux
1 parent 406541e commit 8a97e1d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

isc/py/Callout.cls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@ Parameter SimpleStringFull As Integer = 5;
2222

2323
Parameter SimpleString As Integer = 6;
2424

25-
Parameter DLL As COSEXPRESSION = "$g(^isc.py.Callout, $g(^%SYS(""bindir"")) _ ""iscpython.dll"")";
25+
ClassMethod GetDLL() [ CodeMode = expression ]
26+
{
27+
$g(^isc.py.Callout, $g(^%SYS("bindir")) _ "iscpython." _ $select($$$isWINDOWS:"dll", 1:"so"))
28+
}
2629

2730
/// Should be executed once per system start. Idempotent.
2831
/// Add to ZSTART or production start.
2932
/// write ##class(isc.py.Callout).Setup()
3033
ClassMethod Setup()
3134
{
3235
set sc = $ZF(-4,6,..#PyLibId)
33-
set sc = $ZF(-4,5,..#PyLibId, ..#DLL)
36+
set sc = $ZF(-4,5,..#PyLibId, ..GetDLL())
3437
quit sc
3538
}
3639

@@ -41,7 +44,7 @@ ClassMethod Initialize(debug As %Boolean = {$$$NO}) As %Integer
4144
if debug {
4245
set sc = $ZF(-4,4,..#PyLibId) // unload current copy of inputlib
4346
set sc = $ZF(-4,8) // delete existing process index, if any
44-
set sc = $ZF(-4,7,..#PyLibId, ..#DLL) // override system index
47+
set sc = $ZF(-4,7,..#PyLibId, ..GetDLL()) // override system index
4548
}
4649
do $ZF(-6, ..#PyLibId, ..#Initialize)
4750
}
@@ -71,7 +74,6 @@ ClassMethod SimpleStringFull(code = {"import random;" _ $$$NL _ "x=random.random
7174
set code = $zcvt(code, "O", "UTF8")
7275
set converted = $$$YES
7376
}
74-
set path = ..#DLL
7577
set result = $ZF(-6, ..#PyLibId, ..#SimpleStringFull, code)
7678
set:converted result = $zcvt(result, "I", "UTF8")
7779
quit result
@@ -87,7 +89,6 @@ ClassMethod SimpleString(code As %String = {"import random;" _ $$$NL _ "x=random
8789
set code = $zcvt(code, "O", "UTF8")
8890
set converted = $$$YES
8991
}
90-
set path = ..#DLL
9192
set result = $ZF(-6, ..#PyLibId, ..#SimpleString, code, variable)
9293

9394
set:converted result = $zcvt(result, "I", "UTF8")
@@ -98,7 +99,6 @@ ClassMethod SimpleString(code As %String = {"import random;" _ $$$NL _ "x=random
9899
/// do ##class(isc.py.Callout).Finalize()
99100
ClassMethod Finalize() As %Integer
100101
{
101-
set path = ..#DLL
102102
do $ZF(-6, ..#PyLibId, ..#Finalize)
103103
}
104104

0 commit comments

Comments
 (0)