C++ support: codegen generates C++'s references and avoids copies

This commit is contained in:
Araq 2015-02-03 13:21:05 +01:00
commit e75e421912
7 changed files with 156 additions and 101 deletions

View file

@ -80,8 +80,13 @@ elif defined(windows) or defined(dos):
# Native Windows Implementation
# =======================================================================
#
type
THINSTANCE {.importc: "HINSTANCE".} = pointer
when defined(cpp):
type
THINSTANCE {.importc: "HINSTANCE".} = object
x: pointer
else:
type
THINSTANCE {.importc: "HINSTANCE".} = pointer
proc freeLibrary(lib: THINSTANCE) {.
importc: "FreeLibrary", header: "<windows.h>", stdcall.}