timotheecour / Nim

Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).
http://nim-lang.org/
Other
2 stars 0 forks source link

make a full replacement for winlean #701

Open ringabout opened 3 years ago

ringabout commented 3 years ago

Ref https://github.com/nim-lang/Nim/issues/12327

The problem

std/winlean keep causing problems, but for backward compatibility, we cannot correct the wrong definitions because they are exported.

The solution

Make a replacement module for std/winlean, and replace the std/winlean gradually. We need to correct some procs mainly which are not exported in the standard libraries.

For example we need to change these procs first. Note that createWinApi is not exported, so we can correct the definitions safely.

import std/windefs

proc createWinApi(x: DWORD) {.importc.}

proc userProc*(x: int) =
  var x: DWORD
  createWinAPI(x)

Then we should consider whether we can make further progresses.

timotheecour commented 3 years ago

very relevant: https://github.com/nim-lang/RFCs/issues/344