Skip to content

Commit

Permalink
- Fixed that signals are bound with the new Nim version (1.2.6).
Browse files Browse the repository at this point in the history
  Info: Caused by this pr nim-lang/Nim#13199
- Updated readme to clone the 1.2 branch.
- Updated linux dependency version.

Signed-off-by: Dankr4d <dude569@freenet.de>
  • Loading branch information
Dankr4d committed Sep 2, 2020
1 parent f533ffa commit 168e175
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion BF2142Unlocker.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ requires "winim >= 3.4.0"
when defined(windows):
requires "winregistry >= 0.2.1"
when defined(linux):
requires "psutil >= 0.5.7"
requires "psutil >= 0.6.0"
##

### imports
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ BF2142Unlocker emulates the necessary login and unlock server to be able to play
- `pacman -Syu # Upgrade all packages`
- `pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-openssl mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3-gobject make tar git`
- `cd /c/Users/$USER; mkdir projects; cd projects;`
- `git clone https://github.com/nim-lang/Nim.git`
- `git clone -b version-1-2 https://github.com/nim-lang/Nim.git`
- `cd Nim`
- `./build_all.bat # Build nim and all tools (like nimble)`
- `export PATH="$PATH:/c/Users/$USER/projects/Nim/bin"`
Expand Down
10 changes: 4 additions & 6 deletions signal.nim
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import macros

macro signalNoCheck*(eventProc: untyped): untyped =
# {.exportc, cdecl.}
# {.exportc, cdecl, dynlib.}
let pragmas: NimNode = nnkPragma.newTree(
newIdentNode("exportc"),
newIdentNode("cdecl"),
newIdentNode("dynlib"),
)
when defined(windows):
pragmas.add(newIdentNode("dynlib"))
eventProc.pragma = pragmas
result = quote do:
`eventProc`

macro signal*(eventProc: untyped): untyped =
# {.exportc, cdecl.}
# {.exportc, cdecl, dynlib.}
let pragmas: NimNode = nnkPragma.newTree(
newIdentNode("exportc"),
newIdentNode("cdecl"),
newIdentNode("dynlib"),
)
when defined(windows):
pragmas.add(newIdentNode("dynlib"))
# if not windowShown: return
let windowShownStatement: NimNode = nnkStmtList.newTree(
nnkIfStmt.newTree(
Expand Down

0 comments on commit 168e175

Please sign in to comment.