mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 22:21:09 +03:00

Unfortunately, std.windows.registry changes useWfuncs in a unit test, so we can't have it be immutable like it should be. I'd _really_ like to be able to drop support of pre-Win2K and get rid of the whole issue...
40 lines
1.1 KiB
D
40 lines
1.1 KiB
D
// Written in the D programming language.
|
|
|
|
/**
|
|
* The only purpose of this module is to do the static construction for
|
|
* std.file, to eliminate cyclic construction errors.
|
|
*
|
|
* Copyright: Copyright Digital Mars 2008 - 2009.
|
|
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
|
|
* Authors: $(WEB digitalmars.com, Walter Bright)
|
|
* Source: $(PHOBOSSRC std/___fileinit.d)
|
|
*/
|
|
|
|
/* Copyright Digital Mars 2008 - 2009.
|
|
* Distributed under the Boost Software License, Version 1.0.
|
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
* http://www.boost.org/LICENSE_1_0.txt)
|
|
*/
|
|
module std.__fileinit;
|
|
|
|
version (Windows)
|
|
{
|
|
version (Win32)
|
|
{
|
|
private import std.c.windows.windows;
|
|
|
|
//This really should be immutable, but std.windows.registry messes with
|
|
//it in its unit tests.
|
|
shared bool useWfuncs = true;
|
|
|
|
shared static this()
|
|
{
|
|
// Win 95, 98, ME do not implement the W functions
|
|
useWfuncs = (GetVersion() < 0x80000000);
|
|
}
|
|
}
|
|
else version (Win64)
|
|
{
|
|
enum useWfuncs = true;
|
|
}
|
|
}
|