Am 24.10.2021 um 13:50 schrieb Allin Cottrell:
On Sun, 24 Oct 2021, Sven Schreiber wrote:
> Am 23.10.2021 um 22:19 schrieb Allin Cottrell:
>> On Sat, 23 Oct 2021, Sven Schreiber wrote:
>>
>>> Am 23.10.2021 um 21:59 schrieb Allin Cottrell:
>>>
>>>> My take on this is that it's very unlikely that anyone wants to
branch
>>>> in a script based on "osx" versus "linux" since
they're both at core
>>>> unix variants. So we should be safe just updating the string under
>>>> $sysinfo.os from "osx" to "macos".
>>>
>>> Well, as it happens, I have a non-public package which checks for
"osx"
>>> because it has to give up in that case.
>>
>> Hmm, what is definitely not going to work on macOS?
>
> I'm helping Ekkehart in wrapping his standalone C program with a gretl
> function package that calls the respective executables. A prototype is
> already working nicely (in principle) on Windows and Linux. There is no
> executable for MacOS, however, and that's why I need to test for this
> platform, not just for Windows. Also if there were such a binary in the
> future, it would surely be different from the Linux one, so the test
> remains necessary, I'd say. If $sysinfo.os doesn't spit out "osx"
> anymore, then the package will be broken on gretl versions <2021e.
How about:
<hansl>
function scalar on_macos (void)
string os = $sysinfo.os
return os == "macos" || os == "osx"
end function
</hansl>
OK, that would be a solution. Or simply:
'instring("macos osx", $sysinfo.os)'
But I agree that 'if on_macos' is a nicer idiom.
thanks
sven