@cblake Well, I tried a bit more with your cligen powered memory map code,...
**Work Laptop with Windows 10 (Nim 1.4.4)** : initially compiler complained
about a missing c header... but I was running an old version of cligen so I
uninstalled it and installed again 1.6.1 with nimble. The missing header issue
had gone, but I got a new compiler error. Then I decided to test cligen on
**Home Laptop with Windows 10** (I'm more keen to experiment on this)... here
first I updated Nim to last stable (1.6.12) and then here I installed last
cligen version, 1.6.1. However I get the same compiler error I get on Work
Laptop. Here it is:
$ nim c -d:release --mm:orc cligen_test.nim
Hint: used config file
'C:\Users\Andrea\.choosenim\toolchains\nim-1.6.12\config\nim.cfg' [Conf]
Hint: used config file
'C:\Users\Andrea\.choosenim\toolchains\nim-1.6.12\config\config.nims' [Conf]
..........................................................................................................
C:\Users\Andrea\.nimble\pkgs\cligen-1.6.1\cligen\mfile.nim(131, 17) Error:
type mismatch: got <Handle, cint, cint, int, int, bool, bool>
but expected one of:
proc mopen(fd, fh: cint; fi: FileInfo; prot = PROT_READ; flags = MAP_SHARED;
a = 0.Off; b = Off(-1); allowRemap = false; noShrink = false;
err = stderr): MFile
first type mismatch at position: 1
required type for fd: cint
but expression 'fh' is of type: Handle
proc mopen(fh: cint; prot = PROT_READ; flags = MAP_SHARED; a = 0; b =
Off(-1);
allowRemap = false; noShrink = false; err = stderr): MFile
first type mismatch at position: 1
required type for fh: cint
but expression 'fh' is of type: Handle
proc mopen(path: string; prot = PROT_READ; flags = MAP_SHARED; a = 0; b =
-1;
allowRemap = false; noShrink = false; perMask = 0o000000000666;
err = stderr): MFile
first type mismatch at position: 1
required type for path: string
but expression 'fh' is of type: Handle
expression: mopen(fh, prot, flags, a, b, allowRemap, noShrink)
Run
I wonder if it is Windows specific, or maybe I have a not-so-clean
installation, so it's specific to my configuration (likely so) .