lots of C++ codegen improvements

This commit is contained in:
Araq 2015-02-06 21:26:40 +01:00
commit e84834db79
10 changed files with 71 additions and 119 deletions

View file

@ -183,11 +183,17 @@ proc rawEchoNL() {.inline, compilerproc.} = write(stdout, "\n")
when (defined(windows) and not defined(useWinAnsi)) or defined(nimdoc):
include "system/widestrs"
when defined(windows) and not defined(useWinAnsi):
proc wfopen(filename, mode: WideCString): pointer {.
importc: "_wfopen", nodecl.}
proc wfreopen(filename, mode: WideCString, stream: File): File {.
importc: "_wfreopen", nodecl.}
when defined(windows) and not defined(useWinAnsi):
when defined(cpp):
proc wfopen(filename, mode: WideCString): pointer {.
importcpp: "_wfopen((const wchar_t*)#, (const wchar_t*)#)", nodecl.}
proc wfreopen(filename, mode: WideCString, stream: File): File {.
importc: "_wfreopen((const wchar_t*)#, (const wchar_t*)#)", nodecl.}
else:
proc wfopen(filename, mode: WideCString): pointer {.
importc: "_wfopen", nodecl.}
proc wfreopen(filename, mode: WideCString, stream: File): File {.
importc: "_wfreopen", nodecl.}
proc fopen(filename, mode: cstring): pointer =
var f = newWideCString(filename)