jimn
11/12/2021, 5:08 PM-luring
and shows up as complete in the kotlin/idea compiled cinterop code.
the exe compiles and runs but when it hits the liburing struct definition there should be a static const int size, but instead the exe bails with a cryptic error code. there are a number of glibc/kernel headers which are getting the job done until it gets to this missing constant.napperley
11/14/2021, 2:14 AMnapperley
11/14/2021, 2:16 AMjimn
11/14/2021, 3:45 AMsed --in-place --regexp-extended\
-e 's,for\s*\((\w+\s+)(\w+)\s*=\s*(\w+)\;\s*\2.*<([^;]+)\;.*(\2?(\+\+)\2?).*\),for (\2/*as \1*/ in \3 until \4),'\
-e 's,^\s*void\s*(\w+)\s*(\(.*\))\s*\{\s*$,fun \1\2:Unit{,'\
-e 's,^\s*(\w+_t)\s*(\w+)\s*(\(.*\))\s*\{\s*$,fun \2\3:\1{,'\
-e 's,^\s*void\s*[*](\w+)\s*(\(.*\))\s*\{\s*$,fun \1\2: CPointer<ByteVar> {,'\
-e 's,^\s*int\s*(\w+)\s*(\(.*\))\s*\{\s*$,fun \1\2:Int{,'\
-e 's,^\s*long\s*(\w+)\s*(\(.*\))\s*\{\s*$,fun \1\2:Long{,'\
-e 's,^\s*const\s+char\s*[*]\s*(\w+)\s*(\(.*\))\s*\{\s*$,fun \1\2:String{,' \
-e 's,(\s+|\W)void\s*\*\s*(\w+)(\W),\1\2:CPointer<ByteVar> \3,'\
-e 's,struct\s+(\w+)\s*\*(\w+)(\s|\W),\2:CPointer<\1>\3,'\
-e 's,(\s+|\W)const char\s*\*\s*(\w+)(\W),\1\2:String\3,'\
-e 's,(\s+|\W)unsigned\s+int\s+(\w+)(\W),\1\2:UInt\3,'\
-e 's,(\s+|\W)unsigned\s+long\s+(\w+)(\W),\1\2:ULong\3,'\
-e 's,(\s+|\W)unsigned\s+char\s+(\w+)(\W),\1\2:UByte\3,'\
-e 's,(\s+|\W)int\s+(\w+)(\W),\1\2:Int\3,'\
-e 's,(\s+|\W)long\s+(\w+)(\W),\1\2:Long\3,'\
-e 's,(\s+|\W)size_t\s+(\w+)(\W),\1\2:size_t\3,'\
-e 's,(\s+|\W)char\s*\*\s*(\w+)(\W),\1\2:CPointer<ByteVar>\3,'\
-e 's,struct\s+(\w+)\s*(\w+)(\s|\W),\2:\1\3,'\
-e 's,([^&])\&\s*(\w+),\1\2.ptr,g'\
-e 's,\s*(\w+)\s*[-][>]\s*(\w+), \1.pointed.\2 ,g'\
-e 's,(\s+|\W)(\w+_t)\s+(\w+)(\W),\1\3:\2\4,g'\
-e 's,switch(.*)[{]$,when \1 {,'\
-e 's,case (.*):,\1 -> ,'\
-e 's,(\w+)\s*[|]\s*(\w+), \1 or \2 ,g'\
$@
jimn
11/14/2021, 3:48 AM