summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-02-03 13:21:05 +0100
committerAraq <rumpf_a@web.de>2015-02-04 00:52:45 +0100
commite75e4219121e9120edc4c53eef6af46de9c6eb50 (patch)
treee98b6c525845988b3797ead0638cdd8731eb9e4e /lib/system
parenta400e8f7f39b1bb29245323c6d999f01b46f22c3 (diff)
downloadNim-e75e4219121e9120edc4c53eef6af46de9c6eb50.tar.gz
C++ support: codegen generates C++'s references and avoids copies
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/dyncalls.nim9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim
index e0d99cf88..aab2a7b61 100644
--- a/lib/system/dyncalls.nim
+++ b/lib/system/dyncalls.nim
@@ -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.}