Creating named tempfiles

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 4 01:05:52 PST 2015


On Wed, 04 Feb 2015 00:29:58 -0800, Jonathan M Davis via Digitalmars-d
wrote:

> Oh, wait. Looking over io.h, whereas _wsopen is declared, I see two
> problems. One, MS declared it as
> 
> int _wsopen(const wchar* filename, int oflag, int shflag, int pmode);
> 
> whereas dmc seems to have
> 
> int __CLIB _wsopen(const wchar_t *, int, int, ...);
> 
> So, for some reason, dmc made it variadic.

`pmode` argument is optional (it depends on flags in `oflag`), and 
passing it each time is somewhat annoying. but there is no way to do 
optional args in C, so DMC made function variadic. take the first 
declaration, it's ok.

>  Error 42: Symbol Undefined __wsopen at 12

and yes, it must be `extern(C)`, not `extern(Windows)`, as Daniel told 
you in another post.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150204/b267c0bb/attachment-0001.sig>


More information about the Digitalmars-d mailing list