├── README.md ├── buildsdk.d ├── extractAliases.d ├── legacy_stdio_definitions.c ├── msvcrt140.aliases32 ├── msvcrt140.aliases64 ├── msvcrt_abs.asm ├── msvcrt_atexit.c ├── msvcrt_data.c ├── msvcrt_stub.c ├── oldnames.aliases32 └── oldnames.aliases64 /README.md: -------------------------------------------------------------------------------- 1 | # mingw-w64-libs 2 | 3 | Microsoft's license doesn't permit bundling other prebuilt compilers with their WinSDK & Visual C++ runtime libraries (for 4 | linking, i.e., either the static libs or the import libs for the dynamic runtime). 5 | 6 | This repository consists of a set of tools to generate import libraries for the Windows and Visual C++ runtime DLLs, intended 7 | as drop-in replacement for the official Microsoft import libraries. 8 | 9 | The [MinGW-w64 runtime](https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/) is based on custom 10 | import libraries for the Microsoft DLLs, but also extends the MS runtime for Posix/GNU compatibility and overrides some 11 | functions, e.g., because MinGW uses 80-bit extended precision for `long double`, whereas Microsoft uses 64-bit double precision. 12 | 13 | The generated import libraries here are based on the .def definition files from MinGW-w64, but don't include any MinGW runtime 14 | additions. The libraries are built by the [buildsdk.d](https://github.com/ldc-developers/mingw-w64-libs/blob/master/buildsdk.d) 15 | tool; see the top comment in that file for how to use it. 16 | 17 | The basic approach is: 18 | 19 | 1. Patch the MinGW-w64 .def files by trying to undo all MinGW-specific overriding of Microsoft functions. 20 | 2. Ignore the aliases in the .def files and instead use verified aliases in the `*.aliases{32,64}` files. These files have been 21 | generated via the [extractAliases.d](https://github.com/ldc-developers/mingw-w64-libs/blob/master/extractAliases.d) tool, which 22 | parses the `dumpbin /symbols` output of Microsoft .lib files. 23 | 3. Generate .lib import libraries based on the patched .def files. 24 | 4. Provide a minimal C runtime skeleton in the `msvcrt_*.c` files, providing the `mainCRTStartup` / `WinMainCRTStartup` / 25 | `_DllMainCRTStartup` entry points, invoking the C runtime constructors/destructors, `atexit` handlers etc. These objects are 26 | merged into the generated `vcruntime140.lib` library (targeting the Visual C++ 2015 runtime) and should be enough for a typical 27 | D application. 28 | 29 | Evolution of this approach: 30 | 31 | * https://github.com/dlang/installer/pull/289 32 | * https://github.com/dlang/installer/pull/346 33 | -------------------------------------------------------------------------------- /buildsdk.d: -------------------------------------------------------------------------------- 1 | // 2 | // Convert MingGW-w64 definition files to COFF import libraries 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | // (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | // usage: buildsdk [x86|x64] [mingw-w64-folder] [output-folder] 9 | // 10 | // source files extracted from MinGW-w64: 11 | // https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v6.0.0.tar.bz2 12 | // 13 | // assumes dmd & VC tools cl, lib, link and ml installed and found through path 14 | // and configured to the appropriate architecture 15 | // 16 | 17 | import std.algorithm; 18 | import std.array; 19 | import std.ascii : isDigit; 20 | import std.file; 21 | import std.format : format; 22 | import std.path; 23 | import std.process; 24 | import std.stdio; 25 | import std.string; 26 | 27 | version = verbose; 28 | 29 | bool x64; 30 | 31 | 32 | void runShell(string cmd) 33 | { 34 | version (verbose) 35 | writeln(cmd); 36 | const rc = executeShell(cmd); 37 | if (rc.status) 38 | { 39 | writeln("'", cmd, "' failed with status ", rc.status); 40 | writeln(rc.output); 41 | throw new Exception("'" ~ cmd ~ "' failed"); 42 | } 43 | } 44 | 45 | alias LineTransformer = string delegate(const string line); 46 | string patchLines(string inFile, string outFile, LineTransformer lineTransformer) 47 | { 48 | const lines = std.file.readText(inFile).splitLines; 49 | 50 | bool transformed = false; 51 | const newLines = lines.map!((const string line) 52 | { 53 | const newLine = lineTransformer(line); 54 | if (newLine !is line) 55 | transformed = true; 56 | return newLine; 57 | }).array; 58 | 59 | if (!transformed) 60 | return inFile; 61 | 62 | version (verbose) 63 | writeln(`Patching file "` ~ inFile ~ `" to "` ~ outFile ~ `"`); 64 | 65 | std.file.write(outFile, newLines.join("\n")); 66 | return outFile; 67 | } 68 | 69 | // Preprocesses a 'foo.def.in' file to 'foo.def'. 70 | void generateDef(string inFile, string outFile) 71 | { 72 | const patchedInFile = outFile ~ ".in"; 73 | const realInFile = patchLines(inFile, patchedInFile, (line) 74 | { 75 | // The MinGW-w64 .def.in files use 'F_X86_ANY(DATA)' to hide functions 76 | // overridden by the MinGW runtime, primarily math functions. 77 | return line.replace(" F_X86_ANY(DATA)", ""); 78 | }); 79 | 80 | const includeDir = buildPath(inFile.dirName.dirName, "def-include"); 81 | const archDefine = x64 ? "DEF_X64" : "DEF_I386"; 82 | runShell(`cl /EP /D` ~ archDefine ~ `=1 "/I` ~ includeDir ~ `" "` ~ realInFile ~ `" > "` ~ outFile ~ `"`); 83 | } 84 | 85 | void sanitizeDef(string defFile) 86 | { 87 | // The MinGW runtime overrides some functions and hides the original 88 | // functions by appending a ' DATA' suffix in the .def files. 89 | static __gshared const overriddenMinGWFunctions = 90 | [ 91 | // ucrtbase.def: 92 | "_assert", "_cabs", "_fpreset", "_tzset", 93 | "ceil", "ceilf", "coshf", "fabs", 94 | "feclearexcept", "fegetenv", "fegetexceptflag", "fegetround", "feholdexcept", 95 | "fesetenv", "fesetexceptflag", "fesetround", "fetestexcept", 96 | "floor", "floorf", "modf", "modff", 97 | "lgamma", "lgammaf", "lgammal", 98 | "sinhf", "sqrt", "sqrtf", "wcsnlen", 99 | // additional ones in msvcr100.def: 100 | "__report_gsfailure", 101 | "_byteswap_uint64", "_byteswap_ulong", "_byteswap_ushort", 102 | "_difftime32", "_difftime64", 103 | "_fseeki64", "_ftelli64", 104 | "_get_errno", 105 | "_rotl64", "_rotr64", 106 | "_set_errno", 107 | "_wassert", 108 | "acosf", "asinf", "atan2", "atan2f", "atanf", 109 | "btowc", 110 | "cos", "cosf", "exp", "expf", "fmod", "fmodf", "frexp", "ldexp", 111 | "longjmp", 112 | "llabs", "lldiv", 113 | "log", "log10f", "logf", 114 | "mbrlen", "mbrtowc", "mbsrtowcs", 115 | "pow", "powf", 116 | "sin", "sinf", 117 | "strnlen", 118 | "tanf", "tanhf", 119 | "wcrtomb", "wcsrtombs", "wctob", 120 | "__lc_collate_cp", "_osplatform", 121 | ]; 122 | 123 | patchLines(defFile, defFile, (line) 124 | { 125 | if (line.length == 0) 126 | return line; 127 | 128 | if (line == "; strnlen replaced by emu") 129 | return "strnlen"; 130 | 131 | if (line[0] == ';') 132 | return line; 133 | 134 | if (line == "LIBRARY vcruntime140_app") 135 | return `LIBRARY "vcruntime140.dll"`; 136 | 137 | // The MinGW-w64 .def files specify weak external symbols as 'alias == realName'. 138 | // Just ignore them; they are incomplete and sometimes wrong. 139 | const i = line.indexOf("=="); 140 | if (i > 0) 141 | { 142 | const weakName = strip(line[0 .. i]); 143 | const realName = strip(line[i+2 .. $]); 144 | 145 | if (weakName.indexOf(' ') < 0 && realName.indexOf(' ') < 0) 146 | return ";" ~ line; 147 | } 148 | 149 | // Un-hide functions overridden by the MinGW runtime. 150 | if (line.endsWith(" DATA") || line.endsWith("\tDATA")) 151 | { 152 | foreach (name; overriddenMinGWFunctions) 153 | { 154 | if (line.length == name.length + 5 && line.startsWith(name)) 155 | return name; 156 | } 157 | } 158 | 159 | // Don't export function 'atexit'; we have our own in msvc_atexit.c. 160 | if (line == "atexit") 161 | return ";atexit"; 162 | 163 | // An apparent bug in lib32/shell32.def (there's 'ExtractIconW@12' too). 164 | if (line == "ExtractIconW@") 165 | return ";ExtractIconW@"; 166 | 167 | // Apparent bugs in lib32/api-ms-win-*.def - missing stdcall params size suffix. 168 | if (line[$-1] == '@' && baseName(defFile).startsWith("api-ms-win-")) 169 | return ";" ~ line; 170 | 171 | return line; 172 | }); 173 | } 174 | 175 | void copyDefs(string inDir, string outDir) 176 | { 177 | mkdirRecurse(outDir); 178 | 179 | foreach (f; std.file.dirEntries(inDir, SpanMode.shallow)) 180 | { 181 | const path = f.name; 182 | const lowerPath = toLower(path); 183 | string outFile; 184 | 185 | if (lowerPath.endsWith(".def.in")) 186 | { 187 | auto base = baseName(path)[0 .. $-7]; 188 | if (base == "vcruntime140_app") 189 | base = "vcruntime140"; 190 | 191 | outFile = buildPath(outDir, base ~ ".def"); 192 | generateDef(path, outFile); 193 | } 194 | else if (lowerPath.endsWith(".def")) 195 | { 196 | outFile = buildPath(outDir, baseName(path)); 197 | std.file.copy(path, outFile); 198 | } 199 | 200 | if (outFile !is null) 201 | sanitizeDef(outFile); 202 | } 203 | } 204 | 205 | void def2implib(string defFile) 206 | { 207 | if (!x64) 208 | { 209 | if (defWithStdcallMangling2implib(defFile)) 210 | return; 211 | } 212 | 213 | const libFile = setExtension(defFile, ".lib"); 214 | const machine = x64 ? "X64" : "X86"; 215 | runShell(`lib "/DEF:` ~ defFile ~ `" /MACHINE:` ~ machine ~ ` "/OUT:` ~ libFile ~ `"`); 216 | std.file.remove(setExtension(defFile, ".exp")); 217 | } 218 | 219 | void defs2implibs(string dir) 220 | { 221 | foreach (f; std.file.dirEntries(dir, SpanMode.shallow)) 222 | { 223 | const path = f.name; 224 | if (toLower(path).endsWith(".def")) 225 | def2implib(path); 226 | } 227 | } 228 | 229 | void cl(string outObj, string args) 230 | { 231 | runShell(`cl /c /Zl "/Fo` ~ outObj ~ `" ` ~ args); 232 | } 233 | 234 | string quote(string arg) 235 | { 236 | return `"` ~ arg ~ `"`; 237 | } 238 | 239 | /** 240 | * x86: the WinAPI symbol names in the .def files are stdcall-mangled 241 | * (trailing `@`). These mangled names are required in the import 242 | * library, but the names of the DLL exports don't feature the stdcall 243 | * suffix. 244 | * `lib /DEF` doesn't support the required renaming functionality, so 245 | * we have to go through compiling a D file with the symbols and 246 | * building a DLL with renamed exports to get the appropriate import 247 | * library. 248 | */ 249 | bool defWithStdcallMangling2implib(string defFile) 250 | { 251 | import std.regex : ctRegex, matchFirst; 252 | 253 | string[] functions; 254 | string[] fields; 255 | bool hasRenamedStdcall = false; 256 | 257 | patchLines(defFile, defFile, (line) 258 | { 259 | if (line.length == 0 || line[0] == ';' || 260 | line.startsWith("LIBRARY ") || line.startsWith("EXPORTS")) 261 | return line; 262 | 263 | if (line.endsWith(" DATA") || line.endsWith("\tDATA")) 264 | { 265 | fields ~= line[0 .. $-5]; 266 | return line; 267 | } 268 | 269 | // include fastcall mangle (like stdcall, with additional leading '@') 270 | enum re = ctRegex!r"^@?([a-zA-Z0-9_]+)(@[0-9]+)"; 271 | if (const m = matchFirst(line, re)) 272 | { 273 | string lineSuffix = line[m[0].length .. $]; 274 | if (lineSuffix.startsWith(m[2])) // e.g., 'JetAddColumnA@28@28' 275 | { 276 | /** 277 | * Actually not to be renamed, symbol is exported in mangled form. 278 | * Treat it like 'JetAddColumnA@28' though, because some libraries 279 | * export the same function as both 'JetAddColumnA' and 'JetAddColumnA@28', 280 | * and I don't know how to replicate that with our approach. 281 | */ 282 | lineSuffix = lineSuffix[m[2].length .. $]; 283 | } 284 | 285 | assert(!lineSuffix.startsWith("=")); // renamings not supported 286 | 287 | hasRenamedStdcall = true; 288 | functions ~= m[1]; 289 | // keep the line suffix (e.g., ' @100' => ordinal 100) 290 | return m[0] ~ "=" ~ m[1] ~ lineSuffix; 291 | } 292 | 293 | const firstSpaceIndex = line.indexOf(' '); 294 | const strippedLine = firstSpaceIndex < 0 ? line : line[0 .. firstSpaceIndex]; 295 | const equalsIndex = strippedLine.indexOf('='); 296 | const functionName = equalsIndex > 0 ? strippedLine[equalsIndex+1 .. $] : strippedLine; 297 | functions ~= functionName; 298 | return line; 299 | }); 300 | 301 | if (!hasRenamedStdcall) 302 | return false; 303 | 304 | string src = "module dummy;\n"; 305 | alias Emitter = string delegate(); 306 | void emitOnce(ref bool[string] emittedSymbols, string symbolName, Emitter emitter) 307 | { 308 | if (symbolName !in emittedSymbols) 309 | { 310 | src ~= emitter() ~ "\n"; 311 | emittedSymbols[symbolName] = true; 312 | } 313 | } 314 | 315 | bool[string] emittedFunctions; 316 | foreach (i, name; functions) 317 | { 318 | emitOnce(emittedFunctions, name, () 319 | { 320 | const linkage = name[0] == '?' ? "C++" : "C"; 321 | return `pragma(mangle, "%s") extern(%s) void func%d() {}`.format(name, linkage, i); 322 | }); 323 | } 324 | 325 | bool[string] emittedFields; 326 | foreach (i, name; fields) 327 | { 328 | emitOnce(emittedFields, name, () 329 | { 330 | const linkage = name[0] == '_' ? "C" : "C++"; 331 | return `pragma(mangle, "%s") extern(%s) __gshared int field%d;`.format(name, linkage, i); 332 | }); 333 | } 334 | 335 | const dFile = setExtension(defFile, ".d"); 336 | const objFile = setExtension(defFile, ".obj"); 337 | const dllFile = setExtension(defFile, ".dll"); 338 | 339 | std.file.write(dFile, src); 340 | runShell(`dmd -c -betterC -m32mscoff "-of=` ~ objFile ~ `" ` ~ quote(dFile)); 341 | runShell("link /NOD /NOENTRY /DLL " ~ quote(objFile) ~ ` "/OUT:` ~ dllFile ~ `" "/DEF:` ~ defFile ~ `"`); 342 | 343 | std.file.remove(dFile); 344 | std.file.remove(objFile); 345 | std.file.remove(dllFile); 346 | std.file.remove(setExtension(dllFile, ".exp")); 347 | 348 | return true; 349 | } 350 | 351 | void c2lib(string outDir, string cFile, string clFlags = null) 352 | { 353 | const obj = buildPath(outDir, baseName(cFile).setExtension(".obj")); 354 | const lib = setExtension(obj, ".lib"); 355 | cl(obj, clFlags ~ (clFlags ? " " : null) ~ quote(cFile)); 356 | runShell(`lib "/OUT:` ~ lib ~ `" ` ~ quote(obj)); 357 | std.file.remove(obj); 358 | } 359 | 360 | void buildMsvcrt(string outDir) 361 | { 362 | foreach (lib; std.file.dirEntries(outDir, "*.lib", SpanMode.shallow)) 363 | { 364 | const lowerBase = toLower(baseName(lib.name)); 365 | if (!(lowerBase.startsWith("msvcr") || lowerBase.startsWith("vcruntime"))) 366 | continue; 367 | 368 | // parse version from filename (e.g., 140 for VC++ 2015) 369 | const versionStart = lowerBase[0] == 'm' ? 5 : 9; 370 | const versionLength = lowerBase[versionStart .. $].countUntil!(c => !isDigit(c)); 371 | const msvcrtVersion = versionLength == 0 372 | ? "70" // msvcrt.lib 373 | : lowerBase[versionStart .. versionStart+versionLength]; 374 | 375 | string[] objs; 376 | void addObj(string objFilename, string args) 377 | { 378 | const obj = buildPath(outDir, objFilename); 379 | cl(obj, "/DMSVCRT_VERSION=" ~ msvcrtVersion ~ " " ~ args); 380 | objs ~= obj; 381 | } 382 | 383 | // compile some additional objects 384 | foreach (i; 0 .. 3) 385 | addObj(format!"msvcrt_stub%d.obj"(i), format!"/D_APPTYPE=%d msvcrt_stub.c"(i)); 386 | foreach (i; 1 .. 3) // not needed for DLLs 387 | addObj(format!"msvcrt_stub_wide%d.obj"(i), format!"/D_APPTYPE=%d /D_UNICODE msvcrt_stub.c"(i)); 388 | addObj("msvcrt_data.obj", "msvcrt_data.c"); 389 | addObj("msvcrt_atexit.obj", "msvcrt_atexit.c"); 390 | if (!x64) 391 | { 392 | const obj = buildPath(outDir, "msvcrt_abs.obj"); 393 | runShell(`ml /c /safeseh "/Fo` ~ obj ~ `" msvcrt_abs.asm`); 394 | objs ~= obj; 395 | } 396 | 397 | // merge them into the library 398 | runShell("lib " ~ quote(lib.name) ~ " " ~ objs.map!quote.join(" ")); 399 | 400 | foreach (obj; objs) 401 | std.file.remove(obj); 402 | } 403 | } 404 | 405 | void buildOldnames(string outDir) 406 | { 407 | static struct WeakSymbol { string name; string targetName; } 408 | WeakSymbol[] weakSymbols; 409 | 410 | void processAliasesFile(string path) 411 | { 412 | foreach (line; std.file.readText(path).splitLines) 413 | { 414 | if (line.length == 0 || line[0] == ';') 415 | continue; 416 | 417 | const equalsIndex = line.indexOf('='); 418 | const weakName = line[0 .. equalsIndex]; 419 | const realName = line[equalsIndex+1 .. $]; 420 | 421 | weakSymbols ~= WeakSymbol(weakName, realName); 422 | } 423 | } 424 | 425 | const suffix = x64 ? "64" : "32"; 426 | processAliasesFile("oldnames.aliases" ~ suffix); 427 | // include the weak symbols from msvcrt.lib too 428 | processAliasesFile("msvcrt140.aliases" ~ suffix); 429 | 430 | const oldnames_c = 431 | // access this __ref_oldnames symbol (in msvcrt_stub.c) to drag in the generated linker directives 432 | "int __ref_oldnames;\n" ~ 433 | weakSymbols.map!(sym => 434 | `__pragma(comment(linker, "/alternatename:` ~ sym.name ~ `=` ~ sym.targetName ~ `"));` 435 | ).join("\n"); 436 | 437 | version (verbose) 438 | writeln("\nAuto-generated oldnames.c:\n----------\n", oldnames_c, "\n----------\n"); 439 | 440 | const src = buildPath(outDir, "oldnames.c"); 441 | std.file.write(src, oldnames_c); 442 | c2lib(outDir, src); 443 | std.file.remove(src); 444 | } 445 | 446 | void buildLegacyStdioDefinitions(string outDir) 447 | { 448 | c2lib(outDir, "legacy_stdio_definitions.c", "/O2"); 449 | } 450 | 451 | // create empty uuid.lib (expected by dmd, but UUIDs already in druntime) 452 | void buildUuid(string outDir) 453 | { 454 | const src = buildPath(outDir, "uuid.c"); 455 | std.file.write(src, ""); 456 | c2lib(outDir, src); 457 | std.file.remove(src); 458 | } 459 | 460 | // vfw32.lib is a merge of 3 other libs 461 | void buildVfw32(string outDir) 462 | { 463 | auto srcLibs = [ "msvfw32", "avicap32", "avifil32" ].map!(name => buildPath(outDir, name ~ ".lib")); 464 | const outLib = buildPath(outDir, "vfw32.lib"); 465 | runShell(`lib "/OUT:` ~ outLib ~ `" ` ~ srcLibs.map!quote.join(" ")); 466 | } 467 | 468 | void main(string[] args) 469 | { 470 | x64 = (args.length > 1 && args[1] == "x64"); 471 | const mingwDir = (args.length > 2 ? args[2] : "mingw-w64"); 472 | string outDir = x64 ? "lib64" : "lib32"; 473 | if (args.length > 3) 474 | outDir = args[3]; 475 | 476 | copyDefs(buildPath(mingwDir, "mingw-w64-crt", "lib-common"), outDir); 477 | copyDefs(buildPath(mingwDir, "mingw-w64-crt", "lib" ~ (x64 ? "64" : "32")), outDir); 478 | 479 | defs2implibs(outDir); 480 | 481 | buildMsvcrt(outDir); 482 | buildOldnames(outDir); 483 | buildLegacyStdioDefinitions(outDir); 484 | buildUuid(outDir); 485 | buildVfw32(outDir); 486 | 487 | // rename msvcr.lib to msvcrt.lib as expected by DMD 488 | foreach (lib; std.file.dirEntries(outDir, "msvcr*.lib", SpanMode.shallow)) 489 | { 490 | const base = baseName(lib.name); 491 | if (!isDigit(base[5])) // msvcrt.lib 492 | continue; 493 | const newName = buildPath(outDir, "msvcrt" ~ base[5 .. $]); 494 | version (verbose) 495 | writefln("Renaming '%s' to '%s'", lib.name, newName); 496 | std.file.rename(lib.name, newName); 497 | } 498 | 499 | //version (verbose) {} else 500 | foreach (f; std.file.dirEntries(outDir, "*.def*", SpanMode.shallow)) 501 | std.file.remove(f.name); 502 | } 503 | -------------------------------------------------------------------------------- /extractAliases.d: -------------------------------------------------------------------------------- 1 | import std.file; 2 | import std.process; 3 | import std.stdio; 4 | import std.string; 5 | 6 | string untilFirstSpace(string str) 7 | { 8 | const spaceIndex = str.indexOf(' '); 9 | return spaceIndex < 0 ? str : str[0 .. spaceIndex]; 10 | } 11 | 12 | int main(string[] args) 13 | { 14 | if (args.length != 2) 15 | { 16 | writefln("Usage: %s ", args[0]); 17 | return 1; 18 | } 19 | 20 | const command = `dumpbin /symbols "` ~ args[1] ~ `"`; 21 | const result = executeShell(command); 22 | if (result.status) 23 | { 24 | writefln("Error: '%s' failed with status %d", command, result.status); 25 | return 1; 26 | } 27 | 28 | writeln("; aliases extracted from ", args[1]); 29 | 30 | const lines = splitLines(result.output); 31 | foreach (i; 1 .. lines.length-1) 32 | { 33 | const line = lines[i]; 34 | const previousLine = lines[i-1]; 35 | const nextLine = lines[i+1]; 36 | 37 | const weakExternalIndex = line.indexOf(" WeakExternal | "); 38 | if (weakExternalIndex < 0) 39 | continue; 40 | if (nextLine.indexOf(" 2 Alias record") < 0) 41 | continue; 42 | const externalIndex = previousLine.indexOf(" External | "); 43 | if (externalIndex < 0) 44 | continue; 45 | 46 | const weakName = untilFirstSpace(line[weakExternalIndex+16 .. $]); 47 | const realName = untilFirstSpace(previousLine[externalIndex+16 .. $]); 48 | 49 | writeln(weakName, "=", realName); 50 | } 51 | 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /legacy_stdio_definitions.c: -------------------------------------------------------------------------------- 1 | // VS 2015+ defines the printf/scanf function families inline. 2 | 3 | #if _MSC_VER < 1900 4 | #error Requires Visual C++ 2015 or newer 5 | #endif 6 | 7 | #include 8 | 9 | void __legacy_stdio_definitions() 10 | { 11 | fprintf(NULL, NULL); 12 | fscanf(NULL, NULL); 13 | fwprintf(NULL, NULL); 14 | fwscanf(NULL, NULL); 15 | printf(NULL); 16 | scanf(NULL); 17 | snprintf(NULL, 0, NULL); 18 | _snprintf(NULL, 0, NULL); 19 | sprintf(NULL, NULL); 20 | sscanf(NULL, NULL); 21 | swprintf(NULL, 0, NULL); 22 | swscanf(NULL, NULL); 23 | vfprintf(NULL, NULL, NULL); 24 | vfscanf(NULL, NULL, NULL); 25 | vfwprintf(NULL, NULL, NULL); 26 | vfwscanf(NULL, NULL, NULL); 27 | vprintf(NULL, NULL); 28 | vscanf(NULL, NULL); 29 | vsnprintf(NULL, 0, NULL, NULL); 30 | _vsnprintf(NULL, 0, NULL, NULL); 31 | vsprintf(NULL, NULL, NULL); 32 | vsscanf(NULL, NULL, NULL); 33 | vswprintf(NULL, 0, NULL, NULL); 34 | vswscanf(NULL, NULL, NULL); 35 | vwprintf(NULL, NULL); 36 | vwscanf(NULL, NULL); 37 | wprintf(NULL); 38 | wscanf(NULL); 39 | } 40 | -------------------------------------------------------------------------------- /msvcrt140.aliases32: -------------------------------------------------------------------------------- 1 | ; aliases extracted from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\msvcrt.lib 2 | ___argc_dll=__imp____argc 3 | ___argv_dll=__imp____argv 4 | __commode_dll=__imp___commode 5 | __daylight_dll=__imp___daylight 6 | __environ_dll=__imp___environ 7 | __fmode_dll=__imp___fmode 8 | __HUGE_dll=__imp___HUGE 9 | __osver_dll=__imp___osver 10 | __pctype_dll=__imp___pctype 11 | __pwctype_dll=__imp___pwctype 12 | __pgmptr_dll=__imp___pgmptr 13 | __sys_nerr_dll=__imp___sys_nerr 14 | __timezone_dll=__imp___timezone 15 | __winver_dll=__imp___winver 16 | __winmajor_dll=__imp___winmajor 17 | __winminor_dll=__imp___winminor 18 | __ctype=__imp___ctype 19 | __tzname=__imp___tzname 20 | ___mb_cur_max_dll=__imp____mb_cur_max 21 | __sys_errlist=__imp___sys_errlist 22 | __mbscat=_strcat 23 | __mbscpy=_strcpy 24 | __strcmpi=__stricmp 25 | __mbsdup=__strdup 26 | _ctime=__ctime32 27 | _difftime=__difftime32 28 | __findfirst=__findfirst32 29 | __findfirsti64=__findfirst32i64 30 | __findnext=__findnext32 31 | __findnexti64=__findnext32i64 32 | __fstat=__fstat32 33 | __fstati64=__fstat32i64 34 | __ftime=__ftime32 35 | __futime=__futime32 36 | __getdcwd_nolock=__getdcwd 37 | _gmtime=__gmtime32 38 | _localtime=__localtime32 39 | _mktime=__mktime32 40 | __mkgmtime=__mkgmtime32 41 | __stat=__stat32 42 | __stati64=__stat32i64 43 | _time=__time32 44 | __utime=__utime32 45 | __wctime=__wctime32 46 | __wfindfirst=__wfindfirst32 47 | __wfindfirsti64=__wfindfirst32i64 48 | __wfindnext=__wfindnext32 49 | __wfindnexti64=__wfindnext32i64 50 | __wgetdcwd_nolock=__wgetdcwd 51 | __freea_s=__freea 52 | ___CxxFrameHandler2=___CxxFrameHandler3 53 | _setjmp=___intrinsic_setjmp 54 | __setjmp=___intrinsic_setjmp 55 | __setjmpex=___intrinsic_setjmpex 56 | ?_wopen@@YAHPBGHH@Z=?_wopen@@YAHPB_WHH@Z 57 | ?_wsopen@@YAHPBGHHH@Z=?_wsopen@@YAHPB_WHHH@Z 58 | ?vswprintf@@YAHPAGIPBGPAD@Z=?vswprintf@@YAHPA_WIPB_WPAD@Z 59 | ?_set_invalid_parameter_handler@@YAP6AXPBG00II@ZH@Z=?_set_invalid_parameter_handler@@YAP6AXPB_W00II@ZH@Z 60 | ?_set_invalid_parameter_handler@@YAP6MXPBG00II@ZP6MX000II@Z@Z=?_set_invalid_parameter_handler@@YAP6MXPB_W00II@ZP6MX000II@Z@Z 61 | __wstat=__wstat32 62 | __wstati64=__wstat32i64 63 | __wutime=__wutime32 64 | _swprintf=__swprintf 65 | _vswprintf=__vswprintf 66 | _vsnprintf=__vsnprintf 67 | _vsnprintf_s=__vsnprintf_s 68 | __tcsclen=__mbslen 69 | __tcsclen_l=__mbslen_l 70 | __tcscnlen=__mbsnlen 71 | __tcscnlen_l=__mbsnlen_l 72 | __tclen=__mbclen 73 | __tccpy=__mbccpy 74 | __tccpy_s=__mbccpy_s 75 | __tccpy_l=__mbccpy_l 76 | __tccpy_s_l=__mbccpy_s_l 77 | __tcsncat=__mbsnbcat 78 | __tcsncat_s=__mbsnbcat_s 79 | __tcsncat_l=__mbsnbcat_l 80 | __tcsncat_s_l=(PREFIX)_mbsnbcat_s_l 81 | __tcsncmp=__mbsnbcmp 82 | __tcsncoll=__mbsnbcoll 83 | __tcsncoll_l=__mbsnbcoll_l 84 | __tcsncpy=__mbsnbcpy 85 | __tcsncpy_s=__mbsnbcpy_s 86 | __tcsncpy_l=__mbsnbcpy_l 87 | __tcsncpy_s_l=__mbsnbcpy_s_l 88 | __tcsnicmp=__mbsnbicmp 89 | __tcsnicmp_l=__mbsnbicmp_l 90 | __tcsnicoll=__mbsnbicoll 91 | __tcsnicoll_l=__mbsnbicoll_l 92 | __tcsnset=__mbsnbset 93 | __tcsnset_s=__mbsnbset_s 94 | __tcsnset_l=__mbsnbset_l 95 | __tcsnset_s_l=__mbsnbset_s_l 96 | __tcsnccat=__mbsncat 97 | __tcsnccat_s=__mbsncat_s 98 | __tcsnccat_l=__mbsncat_l 99 | __tcsnccat_s_l=__mbsncat_s_l 100 | __tcsnccmp=__mbsncmp 101 | __tcsnccoll=__mbsncoll 102 | __tcsnccoll_l=__mbsncoll_l 103 | __tcsnccpy=__mbsncpy 104 | __tcsnccpy_s=__mbsncpy_s 105 | __tcsnccpy_l=__mbsncpy_l 106 | __tcsnccpy_s_l=__mbsncpy_s_l 107 | __tcsncicmp=__mbsnicmp 108 | __tcsncicmp_l=__mbsnicmp_l 109 | __tcsncicoll=__mbsnicoll 110 | __tcsncicoll_l=__mbsnicoll_l 111 | __tcsncset=__mbsnset 112 | __tcsncset_s=__mbsnset_s 113 | __tcsncset_l=__mbsnset_l 114 | __tcsncset_s_l=__mbsnset_s_l 115 | __tcslen=__mbslen 116 | __tcschr=__mbschr 117 | __tcscspn=__mbscspn 118 | __tcspbrk=__mbspbrk 119 | __tcsrchr=__mbsrchr 120 | __tcsspn=__mbsspn 121 | __tcsstr=__mbsstr 122 | __tcstok=__mbstok 123 | __tcstok_l=__mbstok_l 124 | __tcstok_s=__mbstok_s 125 | __tcstok_s_l=__mbstok_s_l 126 | __tcsrev=__mbsrev 127 | __tcsset=__mbsset 128 | __tcsset_l=__mbsset_l 129 | __tcsset_s=__mbsset_s 130 | __tcsset_s_l=__mbsset_s_l 131 | __tcsdec=__mbsdec 132 | __tcsinc=__mbsinc 133 | __tcsnbcnt=__mbsnbcnt 134 | __tcsnccnt=__mbsnccnt 135 | __tcsnextc=__mbsnextc 136 | __tcsninc=__mbsninc 137 | __tcsspnp=__mbsspnp 138 | __tcslwr=__mbslwr 139 | __tcslwr_l=__mbslwr_l 140 | __tcslwr_s=__mbslwr_s 141 | __tcslwr_s_l=__mbslwr_s_l 142 | __tcsupr=__mbsupr 143 | __tcsupr_l=__mbsupr_l 144 | __tcsupr_s=__mbsupr_s 145 | __tcsupr_s_l=__mbsupr_s_l 146 | __tcscmp=__mbscmp 147 | __tcsicmp=__mbsicmp 148 | __tcsicmp_l=__mbsicmp_l 149 | __tcscoll=__mbscoll 150 | __tcscoll_l=__mbscoll_l 151 | __tcsicoll=__mbsicoll 152 | __tcsicoll_l=__mbsicoll_l 153 | __imp___mbscat=__imp__strcat 154 | __imp___mbscpy=__imp__strcpy 155 | __imp___strcmpi=__imp___stricmp 156 | __imp___mbsdup=__imp___strdup 157 | __imp__ctime=__imp___ctime32 158 | __imp__difftime=__imp___difftime32 159 | __imp___findfirst=__imp___findfirst32 160 | __imp___findfirsti64=__imp___findfirst32i64 161 | __imp___findnext=__imp___findnext32 162 | __imp___findnexti64=__imp___findnext32i64 163 | __imp___fstat=__imp___fstat32 164 | __imp___fstati64=__imp___fstat32i64 165 | __imp___ftime=__imp___ftime32 166 | __imp___futime=__imp___futime32 167 | __imp__gmtime=__imp___gmtime32 168 | __imp__localtime=__imp___localtime32 169 | __imp__mktime=__imp___mktime32 170 | __imp___mkgmtime=__imp___mkgmtime32 171 | __imp___stat=__imp___stat32 172 | __imp___stati64=__imp___stat32i64 173 | __imp__time=__imp___time32 174 | __imp___utime=__imp___utime32 175 | __imp___wctime=__imp___wctime32 176 | __imp___wfindfirst=__imp___wfindfirst32 177 | __imp___wfindfirsti64=__imp___wfindfirst32i64 178 | __imp___wfindnext=__imp___wfindnext32 179 | __imp___wfindnexti64=__imp___wfindnext32i64 180 | __imp___freea_s=__imp___freea 181 | __imp_?_wopen@@YAHPBGHH@Z=__imp_?_wopen@@YAHPB_WHH@Z 182 | __imp_?_wsopen@@YAHPBGHHH@Z=__imp_?_wsopen@@YAHPB_WHHH@Z 183 | __imp_?vswprintf@@YAHPAGIPBGPAD@Z=__imp_?vswprintf@@YAHPA_WIPB_WPAD@Z 184 | __imp___wstat=__imp___wstat32 185 | __imp___wstati64=__imp___wstat32i64 186 | __imp___wutime=__imp___wutime32 187 | __imp__swprintf=__imp___swprintf 188 | __imp__vswprintf=__imp___vswprintf 189 | __imp__vsnprintf=__imp___vsnprintf 190 | __imp__vsnprintf_s=__imp___vsnprintf_s 191 | __imp_?_set_invalid_parameter_handler@@YAP6AXPBG00II@ZH@Z=__imp_?_set_invalid_parameter_handler@@YAP6AXPB_W00II@ZH@Z 192 | __imp_?_set_invalid_parameter_handler@@YAP6MXPBG00II@ZP6MX000II@Z@Z=__imp_?_set_invalid_parameter_handler@@YAP6MXPB_W00II@ZP6MX000II@Z@Z 193 | __imp___tcsclen=__imp___mbslen 194 | __imp___tcsclen_l=__imp___mbslen_l 195 | __imp___tcscnlen=__imp___mbsnlen 196 | __imp___tcscnlen_l=__imp___mbsnlen_l 197 | __imp___tclen=__imp___mbclen 198 | __imp___tccpy=__imp___mbccpy 199 | __imp___tccpy_s=__imp___mbccpy_s 200 | __imp___tccpy_l=__imp___mbccpy_l 201 | __imp___tccpy_s_l=__imp___mbccpy_s_l 202 | __imp___tcsncat=__imp___mbsnbcat 203 | __imp___tcsncat_s=__imp___mbsnbcat_s 204 | __imp___tcsncat_l=__imp___mbsnbcat_l 205 | __imp___tcsncat_s_l=(PREFIX)_mbsnbcat_s_l 206 | __imp___tcsncmp=__imp___mbsnbcmp 207 | __imp___tcsncoll=__imp___mbsnbcoll 208 | __imp___tcsncoll_l=__imp___mbsnbcoll_l 209 | __imp___tcsncpy=__imp___mbsnbcpy 210 | __imp___tcsncpy_s=__imp___mbsnbcpy_s 211 | __imp___tcsncpy_l=__imp___mbsnbcpy_l 212 | __imp___tcsncpy_s_l=__imp___mbsnbcpy_s_l 213 | __imp___tcsnicmp=__imp___mbsnbicmp 214 | __imp___tcsnicmp_l=__imp___mbsnbicmp_l 215 | __imp___tcsnicoll=__imp___mbsnbicoll 216 | __imp___tcsnicoll_l=__imp___mbsnbicoll_l 217 | __imp___tcsnset=__imp___mbsnbset 218 | __imp___tcsnset_s=__imp___mbsnbset_s 219 | __imp___tcsnset_l=__imp___mbsnbset_l 220 | __imp___tcsnset_s_l=__imp___mbsnbset_s_l 221 | __imp___tcsnccat=__imp___mbsncat 222 | __imp___tcsnccat_s=__imp___mbsncat_s 223 | __imp___tcsnccat_l=__imp___mbsncat_l 224 | __imp___tcsnccat_s_l=__imp___mbsncat_s_l 225 | __imp___tcsnccmp=__imp___mbsncmp 226 | __imp___tcsnccoll=__imp___mbsncoll 227 | __imp___tcsnccoll_l=__imp___mbsncoll_l 228 | __imp___tcsnccpy=__imp___mbsncpy 229 | __imp___tcsnccpy_s=__imp___mbsncpy_s 230 | __imp___tcsnccpy_l=__imp___mbsncpy_l 231 | __imp___tcsnccpy_s_l=__imp___mbsncpy_s_l 232 | __imp___tcsncicmp=__imp___mbsnicmp 233 | __imp___tcsncicmp_l=__imp___mbsnicmp_l 234 | __imp___tcsncicoll=__imp___mbsnicoll 235 | __imp___tcsncicoll_l=__imp___mbsnicoll_l 236 | __imp___tcsncset=__imp___mbsnset 237 | __imp___tcsncset_s=__imp___mbsnset_s 238 | __imp___tcsncset_l=__imp___mbsnset_l 239 | __imp___tcsncset_s_l=__imp___mbsnset_s_l 240 | __imp___tcslen=__imp___mbslen 241 | __imp___tcschr=__imp___mbschr 242 | __imp___tcscspn=__imp___mbscspn 243 | __imp___tcspbrk=__imp___mbspbrk 244 | __imp___tcsrchr=__imp___mbsrchr 245 | __imp___tcsspn=__imp___mbsspn 246 | __imp___tcsstr=__imp___mbsstr 247 | __imp___tcstok=__imp___mbstok 248 | __imp___tcstok_l=__imp___mbstok_l 249 | __imp___tcstok_s=__imp___mbstok_s 250 | __imp___tcstok_s_l=__imp___mbstok_s_l 251 | __imp___tcsrev=__imp___mbsrev 252 | __imp___tcsset=__imp___mbsset 253 | __imp___tcsset_l=__imp___mbsset_l 254 | __imp___tcsset_s=__imp___mbsset_s 255 | __imp___tcsset_s_l=__imp___mbsset_s_l 256 | __imp___tcsdec=__imp___mbsdec 257 | __imp___tcsinc=__imp___mbsinc 258 | __imp___tcsnbcnt=__imp___mbsnbcnt 259 | __imp___tcsnccnt=__imp___mbsnccnt 260 | __imp___tcsnextc=__imp___mbsnextc 261 | __imp___tcsninc=__imp___mbsninc 262 | __imp___tcsspnp=__imp___mbsspnp 263 | __imp___tcslwr=__imp___mbslwr 264 | __imp___tcslwr_l=__imp___mbslwr_l 265 | __imp___tcslwr_s=__imp___mbslwr_s 266 | __imp___tcslwr_s_l=__imp___mbslwr_s_l 267 | __imp___tcsupr=__imp___mbsupr 268 | __imp___tcsupr_l=__imp___mbsupr_l 269 | __imp___tcsupr_s=__imp___mbsupr_s 270 | __imp___tcsupr_s_l=__imp___mbsupr_s_l 271 | __imp___tcscmp=__imp___mbscmp 272 | __imp___tcsicmp=__imp___mbsicmp 273 | __imp___tcsicmp_l=__imp___mbsicmp_l 274 | __imp___tcscoll=__imp___mbscoll 275 | __imp___tcscoll_l=__imp___mbscoll_l 276 | __imp___tcsicoll=__imp___mbsicoll 277 | __imp___tcsicoll_l=__imp___mbsicoll_l 278 | -------------------------------------------------------------------------------- /msvcrt140.aliases64: -------------------------------------------------------------------------------- 1 | ; aliases extracted from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\msvcrt.lib 2 | __argc_dll=__imp___argc 3 | __argv_dll=__imp___argv 4 | _commode_dll=__imp__commode 5 | _daylight_dll=__imp__daylight 6 | _environ_dll=__imp__environ 7 | _fmode_dll=__imp__fmode 8 | _HUGE_dll=__imp__HUGE 9 | _osver_dll=__imp__osver 10 | _pctype_dll=__imp__pctype 11 | _pwctype_dll=__imp__pwctype 12 | _pgmptr_dll=__imp__pgmptr 13 | _sys_nerr_dll=__imp__sys_nerr 14 | _timezone_dll=__imp__timezone 15 | _winver_dll=__imp__winver 16 | _winmajor_dll=__imp__winmajor 17 | _winminor_dll=__imp__winminor 18 | _ctype=__imp__ctype 19 | _tzname=__imp__tzname 20 | __mb_cur_max_dll=__imp___mb_cur_max 21 | _sys_errlist=__imp__sys_errlist 22 | _mbscat=strcat 23 | _mbscpy=strcpy 24 | _strcmpi=_stricmp 25 | _mbsdup=_strdup 26 | ctime=_ctime32 27 | difftime=_difftime32 28 | _findfirst=_findfirst32 29 | _findfirsti64=_findfirst32i64 30 | _findnext=_findnext32 31 | _findnexti64=_findnext32i64 32 | _fstat=_fstat32 33 | _fstati64=_fstat32i64 34 | _ftime=_ftime32 35 | _futime=_futime32 36 | _getdcwd_nolock=_getdcwd 37 | gmtime=_gmtime32 38 | localtime=_localtime32 39 | mktime=_mktime32 40 | _mkgmtime=_mkgmtime32 41 | _stat=_stat32 42 | _stati64=_stat32i64 43 | time=_time32 44 | _utime=_utime32 45 | _wctime=_wctime32 46 | _wfindfirst=_wfindfirst32 47 | _wfindfirsti64=_wfindfirst32i64 48 | _wfindnext=_wfindnext32 49 | _wfindnexti64=_wfindnext32i64 50 | _wgetdcwd_nolock=_wgetdcwd 51 | _freea_s=_freea 52 | __CxxFrameHandler2=__CxxFrameHandler3 53 | setjmp=__intrinsic_setjmp 54 | _setjmp=__intrinsic_setjmp 55 | _setjmpex=__intrinsic_setjmpex 56 | ?_wopen@@YAHPEBGHH@Z=?_wopen@@YAHPEB_WHH@Z 57 | ?_wsopen@@YAHPEBGHHH@Z=?_wsopen@@YAHPEB_WHHH@Z 58 | ?_set_invalid_parameter_handler@@YAP6AXPEBG00I_K@ZH@Z=?_set_invalid_parameter_handler@@YAP6AXPEB_W00I_K@ZH@Z 59 | ?_set_invalid_parameter_handler@@YAP6MXPEBG00I_K@ZP6MX000I1@Z@Z=?_set_invalid_parameter_handler@@YAP6MXPEB_W00I_K@ZP6MX000I1@Z@Z 60 | _wstat=_wstat32 61 | _wstati64=_wstat32i64 62 | _wutime=_wutime32 63 | swprintf=_swprintf 64 | vswprintf=_vswprintf 65 | vsnprintf=_vsnprintf 66 | vsnprintf_s=_vsnprintf_s 67 | _tcsclen=_mbslen 68 | _tcsclen_l=_mbslen_l 69 | _tcscnlen=_mbsnlen 70 | _tcscnlen_l=_mbsnlen_l 71 | _tclen=_mbclen 72 | _tccpy=_mbccpy 73 | _tccpy_s=_mbccpy_s 74 | _tccpy_l=_mbccpy_l 75 | _tccpy_s_l=_mbccpy_s_l 76 | _tcsncat=_mbsnbcat 77 | _tcsncat_s=_mbsnbcat_s 78 | _tcsncat_l=_mbsnbcat_l 79 | _tcsncat_s_l=(PREFIX)_mbsnbcat_s_l 80 | _tcsncmp=_mbsnbcmp 81 | _tcsncoll=_mbsnbcoll 82 | _tcsncoll_l=_mbsnbcoll_l 83 | _tcsncpy=_mbsnbcpy 84 | _tcsncpy_s=_mbsnbcpy_s 85 | _tcsncpy_l=_mbsnbcpy_l 86 | _tcsncpy_s_l=_mbsnbcpy_s_l 87 | _tcsnicmp=_mbsnbicmp 88 | _tcsnicmp_l=_mbsnbicmp_l 89 | _tcsnicoll=_mbsnbicoll 90 | _tcsnicoll_l=_mbsnbicoll_l 91 | _tcsnset=_mbsnbset 92 | _tcsnset_s=_mbsnbset_s 93 | _tcsnset_l=_mbsnbset_l 94 | _tcsnset_s_l=_mbsnbset_s_l 95 | _tcsnccat=_mbsncat 96 | _tcsnccat_s=_mbsncat_s 97 | _tcsnccat_l=_mbsncat_l 98 | _tcsnccat_s_l=_mbsncat_s_l 99 | _tcsnccmp=_mbsncmp 100 | _tcsnccoll=_mbsncoll 101 | _tcsnccoll_l=_mbsncoll_l 102 | _tcsnccpy=_mbsncpy 103 | _tcsnccpy_s=_mbsncpy_s 104 | _tcsnccpy_l=_mbsncpy_l 105 | _tcsnccpy_s_l=_mbsncpy_s_l 106 | _tcsncicmp=_mbsnicmp 107 | _tcsncicmp_l=_mbsnicmp_l 108 | _tcsncicoll=_mbsnicoll 109 | _tcsncicoll_l=_mbsnicoll_l 110 | _tcsncset=_mbsnset 111 | _tcsncset_s=_mbsnset_s 112 | _tcsncset_l=_mbsnset_l 113 | _tcsncset_s_l=_mbsnset_s_l 114 | _tcslen=_mbslen 115 | _tcschr=_mbschr 116 | _tcscspn=_mbscspn 117 | _tcspbrk=_mbspbrk 118 | _tcsrchr=_mbsrchr 119 | _tcsspn=_mbsspn 120 | _tcsstr=_mbsstr 121 | _tcstok=_mbstok 122 | _tcstok_l=_mbstok_l 123 | _tcstok_s=_mbstok_s 124 | _tcstok_s_l=_mbstok_s_l 125 | _tcsrev=_mbsrev 126 | _tcsset=_mbsset 127 | _tcsset_l=_mbsset_l 128 | _tcsset_s=_mbsset_s 129 | _tcsset_s_l=_mbsset_s_l 130 | _tcsdec=_mbsdec 131 | _tcsinc=_mbsinc 132 | _tcsnbcnt=_mbsnbcnt 133 | _tcsnccnt=_mbsnccnt 134 | _tcsnextc=_mbsnextc 135 | _tcsninc=_mbsninc 136 | _tcsspnp=_mbsspnp 137 | _tcslwr=_mbslwr 138 | _tcslwr_l=_mbslwr_l 139 | _tcslwr_s=_mbslwr_s 140 | _tcslwr_s_l=_mbslwr_s_l 141 | _tcsupr=_mbsupr 142 | _tcsupr_l=_mbsupr_l 143 | _tcsupr_s=_mbsupr_s 144 | _tcsupr_s_l=_mbsupr_s_l 145 | _tcscmp=_mbscmp 146 | _tcsicmp=_mbsicmp 147 | _tcsicmp_l=_mbsicmp_l 148 | _tcscoll=_mbscoll 149 | _tcscoll_l=_mbscoll_l 150 | _tcsicoll=_mbsicoll 151 | _tcsicoll_l=_mbsicoll_l 152 | __imp__mbscat=__imp_strcat 153 | __imp__mbscpy=__imp_strcpy 154 | __imp__strcmpi=__imp__stricmp 155 | __imp__mbsdup=__imp__strdup 156 | __imp_ctime=__imp__ctime32 157 | __imp_difftime=__imp__difftime32 158 | __imp__findfirst=__imp__findfirst32 159 | __imp__findfirsti64=__imp__findfirst32i64 160 | __imp__findnext=__imp__findnext32 161 | __imp__findnexti64=__imp__findnext32i64 162 | __imp__fstat=__imp__fstat32 163 | __imp__fstati64=__imp__fstat32i64 164 | __imp__ftime=__imp__ftime32 165 | __imp__futime=__imp__futime32 166 | __imp_gmtime=__imp__gmtime32 167 | __imp_localtime=__imp__localtime32 168 | __imp_mktime=__imp__mktime32 169 | __imp__mkgmtime=__imp__mkgmtime32 170 | __imp__stat=__imp__stat32 171 | __imp__stati64=__imp__stat32i64 172 | __imp_time=__imp__time32 173 | __imp__utime=__imp__utime32 174 | __imp__wctime=__imp__wctime32 175 | __imp__wfindfirst=__imp__wfindfirst32 176 | __imp__wfindfirsti64=__imp__wfindfirst32i64 177 | __imp__wfindnext=__imp__wfindnext32 178 | __imp__wfindnexti64=__imp__wfindnext32i64 179 | __imp__freea_s=__imp__freea 180 | __imp_?_wopen@@YAHPEBGHH@Z=__imp_?_wopen@@YAHPEB_WHH@Z 181 | __imp_?_wsopen@@YAHPEBGHHH@Z=__imp_?_wsopen@@YAHPEB_WHHH@Z 182 | __imp__wstat=__imp__wstat32 183 | __imp__wstati64=__imp__wstat32i64 184 | __imp__wutime=__imp__wutime32 185 | __imp_swprintf=__imp__swprintf 186 | __imp_vswprintf=__imp__vswprintf 187 | __imp_vsnprintf=__imp__vsnprintf 188 | __imp_vsnprintf_s=__imp__vsnprintf_s 189 | __imp_?_set_invalid_parameter_handler@@YAP6AXPBG00II@ZH@Z=__imp_?_set_invalid_parameter_handler@@YAP6AXPB_W00II@ZH@Z 190 | __imp_?_set_invalid_parameter_handler@@YAP6MXPBG00II@ZP6MX000II@Z@Z=__imp_?_set_invalid_parameter_handler@@YAP6MXPB_W00II@ZP6MX000II@Z@Z 191 | __imp__tcsclen=__imp__mbslen 192 | __imp__tcsclen_l=__imp__mbslen_l 193 | __imp__tcscnlen=__imp__mbsnlen 194 | __imp__tcscnlen_l=__imp__mbsnlen_l 195 | __imp__tclen=__imp__mbclen 196 | __imp__tccpy=__imp__mbccpy 197 | __imp__tccpy_s=__imp__mbccpy_s 198 | __imp__tccpy_l=__imp__mbccpy_l 199 | __imp__tccpy_s_l=__imp__mbccpy_s_l 200 | __imp__tcsncat=__imp__mbsnbcat 201 | __imp__tcsncat_s=__imp__mbsnbcat_s 202 | __imp__tcsncat_l=__imp__mbsnbcat_l 203 | __imp__tcsncat_s_l=(PREFIX)_mbsnbcat_s_l 204 | __imp__tcsncmp=__imp__mbsnbcmp 205 | __imp__tcsncoll=__imp__mbsnbcoll 206 | __imp__tcsncoll_l=__imp__mbsnbcoll_l 207 | __imp__tcsncpy=__imp__mbsnbcpy 208 | __imp__tcsncpy_s=__imp__mbsnbcpy_s 209 | __imp__tcsncpy_l=__imp__mbsnbcpy_l 210 | __imp__tcsncpy_s_l=__imp__mbsnbcpy_s_l 211 | __imp__tcsnicmp=__imp__mbsnbicmp 212 | __imp__tcsnicmp_l=__imp__mbsnbicmp_l 213 | __imp__tcsnicoll=__imp__mbsnbicoll 214 | __imp__tcsnicoll_l=__imp__mbsnbicoll_l 215 | __imp__tcsnset=__imp__mbsnbset 216 | __imp__tcsnset_s=__imp__mbsnbset_s 217 | __imp__tcsnset_l=__imp__mbsnbset_l 218 | __imp__tcsnset_s_l=__imp__mbsnbset_s_l 219 | __imp__tcsnccat=__imp__mbsncat 220 | __imp__tcsnccat_s=__imp__mbsncat_s 221 | __imp__tcsnccat_l=__imp__mbsncat_l 222 | __imp__tcsnccat_s_l=__imp__mbsncat_s_l 223 | __imp__tcsnccmp=__imp__mbsncmp 224 | __imp__tcsnccoll=__imp__mbsncoll 225 | __imp__tcsnccoll_l=__imp__mbsncoll_l 226 | __imp__tcsnccpy=__imp__mbsncpy 227 | __imp__tcsnccpy_s=__imp__mbsncpy_s 228 | __imp__tcsnccpy_l=__imp__mbsncpy_l 229 | __imp__tcsnccpy_s_l=__imp__mbsncpy_s_l 230 | __imp__tcsncicmp=__imp__mbsnicmp 231 | __imp__tcsncicmp_l=__imp__mbsnicmp_l 232 | __imp__tcsncicoll=__imp__mbsnicoll 233 | __imp__tcsncicoll_l=__imp__mbsnicoll_l 234 | __imp__tcsncset=__imp__mbsnset 235 | __imp__tcsncset_s=__imp__mbsnset_s 236 | __imp__tcsncset_l=__imp__mbsnset_l 237 | __imp__tcsncset_s_l=__imp__mbsnset_s_l 238 | __imp__tcslen=__imp__mbslen 239 | __imp__tcschr=__imp__mbschr 240 | __imp__tcscspn=__imp__mbscspn 241 | __imp__tcspbrk=__imp__mbspbrk 242 | __imp__tcsrchr=__imp__mbsrchr 243 | __imp__tcsspn=__imp__mbsspn 244 | __imp__tcsstr=__imp__mbsstr 245 | __imp__tcstok=__imp__mbstok 246 | __imp__tcstok_l=__imp__mbstok_l 247 | __imp__tcstok_s=__imp__mbstok_s 248 | __imp__tcstok_s_l=__imp__mbstok_s_l 249 | __imp__tcsrev=__imp__mbsrev 250 | __imp__tcsset=__imp__mbsset 251 | __imp__tcsset_l=__imp__mbsset_l 252 | __imp__tcsset_s=__imp__mbsset_s 253 | __imp__tcsset_s_l=__imp__mbsset_s_l 254 | __imp__tcsdec=__imp__mbsdec 255 | __imp__tcsinc=__imp__mbsinc 256 | __imp__tcsnbcnt=__imp__mbsnbcnt 257 | __imp__tcsnccnt=__imp__mbsnccnt 258 | __imp__tcsnextc=__imp__mbsnextc 259 | __imp__tcsninc=__imp__mbsninc 260 | __imp__tcsspnp=__imp__mbsspnp 261 | __imp__tcslwr=__imp__mbslwr 262 | __imp__tcslwr_l=__imp__mbslwr_l 263 | __imp__tcslwr_s=__imp__mbslwr_s 264 | __imp__tcslwr_s_l=__imp__mbslwr_s_l 265 | __imp__tcsupr=__imp__mbsupr 266 | __imp__tcsupr_l=__imp__mbsupr_l 267 | __imp__tcsupr_s=__imp__mbsupr_s 268 | __imp__tcsupr_s_l=__imp__mbsupr_s_l 269 | __imp__tcscmp=__imp__mbscmp 270 | __imp__tcsicmp=__imp__mbsicmp 271 | __imp__tcsicmp_l=__imp__mbsicmp_l 272 | __imp__tcscoll=__imp__mbscoll 273 | __imp__tcscoll_l=__imp__mbscoll_l 274 | __imp__tcsicoll=__imp__mbsicoll 275 | __imp__tcsicoll_l=__imp__mbsicoll_l 276 | -------------------------------------------------------------------------------- /msvcrt_abs.asm: -------------------------------------------------------------------------------- 1 | ;; absolute symbols 2 | public __except_list 3 | public __tls_array 4 | 5 | ;; symbols not exported by the shared runtime 6 | public __alldiv 7 | public __allrem 8 | public __aulldiv 9 | public __aullrem 10 | 11 | __except_list EQU 0 12 | __tls_array EQU 02ch 13 | 14 | ;;/** 15 | ;; * Support for 64-bit longs. 16 | ;; * 17 | ;; * Copyright: Copyright Digital Mars 2000 - 2012. 18 | ;; * License: Distributed under the 19 | ;; * $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0). 20 | ;; * (See accompanying file LICENSE) 21 | ;; * Authors: Walter Bright, Sean Kelly 22 | ;; * Source: $(DRUNTIMESRC src/rt/_llmath.d) 23 | ;; */ 24 | ;; 25 | ;;copied from druntime module rt.llmath; 26 | 27 | _TEXT segment para use32 public 'CODE' 28 | assume CS:_TEXT 29 | 30 | ;;/*************************************** 31 | ;; * Unsigned long divide. 32 | ;; * Input: 33 | ;; * [EDX,EAX],[ECX,EBX] 34 | ;; * Output: 35 | ;; * [EDX,EAX] = [EDX,EAX] / [ECX,EBX] 36 | ;; * [ECX,EBX] = [EDX,EAX] % [ECX,EBX] 37 | ;; */ 38 | 39 | __ULDIV__ proc 40 | 41 | test ECX,ECX ; 42 | jz uldiv ; 43 | 44 | ; if ECX > EDX, then quotient is 0 and remainder is [EDX,EAX] 45 | cmp ECX,EDX ; 46 | ja quo0 ; 47 | 48 | test ECX,ECX ; 49 | js Lleft ; 50 | 51 | ;/* We have n>d, and know that n/d will fit in 32 bits. 52 | ; * d will be left justified if we shift it left s bits. 53 | ; * [d1,d0] <<= s 54 | ; * [n2,n1,n0] = [n1,n0] << s 55 | ; * 56 | ; * Use one divide, by this reasoning: 57 | ; * ([n2,n1]<<32 + n0)/(d1<<32 + d0) 58 | ; * becomes: 59 | ; * ([n2,n1]<<32)/(d1<<32 + d0) + n0/(d1<<32 + d0) 60 | ; * The second divide is always 0. 61 | ; * Ignore the d0 in the first divide, which will yield a quotient 62 | ; * that might be too high by 1 (because d1 is left justified). 63 | ; * We can tell if it's too big if: 64 | ; * q*[d1,d0] > [n2,n1,n0] 65 | ; * which is: 66 | ; * q*[d1,d0] > [[q*[d1,0]+q%[d1,0],n1,n0] 67 | ; * If we subtract q*[d1,0] from both sides, we get: 68 | ; * q*d0 > [[n2,n1]%d1,n0] 69 | ; * So if it is too big by one, reduce q by one to q'=q-one. 70 | ; * Compute remainder as: 71 | ; * r = ([n1,n0] - q'*[d1,d0]) >> s 72 | ; * Again, we can subtract q*[d1,0]: 73 | ; * r = ([n1,n0] - q*[d1,0] - (q'*[d1,d0] - q*[d1,0])) >> s 74 | ; * r = ([[n2,n1]%d1,n0] + (q*[d1,0] - (q - one)*[d1,d0])) >> s 75 | ; * r = ([[n2,n1]%d1,n0] + (q*[d1,0] - [d1 *(q-one),d0*(1-q)])) >> s 76 | ; * r = ([[n2,n1]%d1,n0] + [d1 *one,d0*(one-q)])) >> s 77 | ; */ 78 | 79 | push EBP ; 80 | push ESI ; 81 | push EDI ; 82 | 83 | mov ESI,EDX ; 84 | mov EDI,EAX ; 85 | mov EBP,ECX ; 86 | 87 | bsr EAX,ECX ; // EAX is now 30..0 88 | xor EAX,01Fh ; // EAX is now 1..31 89 | mov CH,AL ; 90 | neg EAX ; 91 | add EAX,32 ; 92 | mov CL,AL ; 93 | 94 | mov EAX,EBX ; 95 | shr EAX,CL ; 96 | xchg CH,CL ; 97 | shl EBP,CL ; 98 | or EBP,EAX ; 99 | shl EBX,CL ; 100 | 101 | mov EDX,ESI ; 102 | xchg CH,CL ; 103 | shr EDX,CL ; 104 | 105 | mov EAX,EDI ; 106 | shr EAX,CL ; 107 | xchg CH,CL ; 108 | shl EDI,CL ; 109 | shl ESI,CL ; 110 | or EAX,ESI ; 111 | 112 | div EBP ; 113 | push EBP ; 114 | mov EBP,EAX ; 115 | mov ESI,EDX ; 116 | 117 | mul EBX ; 118 | cmp EDX,ESI ; 119 | ja L1 ; 120 | jb L2 ; 121 | cmp EAX,EDI ; 122 | jbe L2 ; 123 | L1: dec EBP ; 124 | sub EAX,EBX ; 125 | sbb EDX,0[ESP] ; 126 | L2: 127 | add ESP,4 ; 128 | sub EDI,EAX ; 129 | sbb ESI,EDX ; 130 | mov EAX,ESI ; 131 | xchg CH,CL ; 132 | shl EAX,CL ; 133 | xchg CH,CL ; 134 | shr EDI,CL ; 135 | or EDI,EAX ; 136 | shr ESI,CL ; 137 | mov EBX,EDI ; 138 | mov ECX,ESI ; 139 | mov EAX,EBP ; 140 | xor EDX,EDX ; 141 | 142 | pop EDI ; 143 | pop ESI ; 144 | pop EBP ; 145 | ret ; 146 | 147 | uldiv: test EDX,EDX ; 148 | jnz D3 ; 149 | ; Both high words are 0, we can use the DIV instruction 150 | div EBX ; 151 | mov EBX,EDX ; 152 | mov EDX,ECX ; // EDX = ECX = 0 153 | ret ; 154 | 155 | even ; 156 | D3: ; Divide [EDX,EAX] by EBX 157 | mov ECX,EAX ; 158 | mov EAX,EDX ; 159 | xor EDX,EDX ; 160 | div EBX ; 161 | xchg ECX,EAX ; 162 | div EBX ; 163 | ; ECX,EAX = result 164 | ; EDX = remainder 165 | mov EBX,EDX ; 166 | mov EDX,ECX ; 167 | xor ECX,ECX ; 168 | ret ; 169 | 170 | quo0: ; Quotient is 0 171 | ; Remainder is [EDX,EAX] 172 | mov EBX,EAX ; 173 | mov ECX,EDX ; 174 | xor EAX,EAX ; 175 | xor EDX,EDX ; 176 | ret ; 177 | 178 | Lleft: ; The quotient is 0 or 1 and EDX >= ECX 179 | cmp EDX,ECX ; 180 | ja quo1 ; // [EDX,EAX] > [ECX,EBX] 181 | ; EDX == ECX 182 | cmp EAX,EBX ; 183 | jb quo0 ; 184 | 185 | quo1: ; Quotient is 1 186 | ; Remainder is [EDX,EAX] - [ECX,EBX] 187 | sub EAX,EBX ; 188 | sbb EDX,ECX ; 189 | mov EBX,EAX ; 190 | mov ECX,EDX ; 191 | mov EAX,1 ; 192 | xor EDX,EDX ; 193 | ret ; 194 | 195 | __ULDIV__ endp 196 | 197 | ;;/*************************************** 198 | ;; * Signed long divide. 199 | ;; * Input: 200 | ;; * [EDX,EAX],[ECX,EBX] 201 | ;; * Output: 202 | ;; * [EDX,EAX] = [EDX,EAX] / [ECX,EBX] 203 | ;; * [ECX,EBX] = [EDX,EAX] % [ECX,EBX] 204 | ;; */ 205 | ;; 206 | __LDIV__ proc 207 | 208 | test EDX,EDX ; // [EDX,EAX] negative? 209 | jns L10 ; // no 210 | ; neg64 EDX,EAX ; // [EDX,EAX] = -[EDX,EAX] 211 | neg EDX ; 212 | neg EAX ; 213 | sbb EDX,0 ; 214 | test ECX,ECX ; // [ECX,EBX] negative? 215 | jns L11 ; // no 216 | ; neg64 ECX,EBX ; 217 | neg ECX ; 218 | neg EBX ; 219 | sbb ECX,0 ; 220 | call __ULDIV__ ; 221 | ; neg64 ECX,EBX ; // remainder same sign as dividend 222 | neg ECX ; 223 | neg EBX ; 224 | sbb ECX,0 ; 225 | ret ; 226 | 227 | L11: call __ULDIV__ ; 228 | ; neg64 ECX,EBX ; // remainder same sign as dividend 229 | neg ECX ; 230 | neg EBX ; 231 | sbb ECX,0 ; 232 | ; neg64 EDX,EAX ; // quotient is negative 233 | neg EDX ; 234 | neg EAX ; 235 | sbb EDX,0 ; 236 | ret ; 237 | 238 | L10: test ECX,ECX ; // [ECX,EBX] negative? 239 | jns L12 ; // no (all is positive) 240 | ; neg64 ECX,EBX ; 241 | neg ECX ; 242 | neg EBX ; 243 | sbb ECX,0 ; 244 | call __ULDIV__ ; 245 | ; neg64 EDX,EAX ; // quotient is negative 246 | neg EDX ; 247 | neg EAX ; 248 | sbb EDX,0 ; 249 | ret ; 250 | 251 | L12: jmp __ULDIV__ ; 252 | 253 | __LDIV__ endp 254 | 255 | ;; * Input 256 | ;; * [ESP+4] QWORD: dividend 257 | ;; * [ESP+12] QWORD: divisor 258 | ;; * Output 259 | ;; * [EDX,EAX] = quotient 260 | __alldiv proc 261 | 262 | push EBX 263 | mov EAX,[ESP+8] 264 | mov EDX,[ESP+12] 265 | mov EBX,[ESP+16] 266 | mov ECX,[ESP+20] 267 | 268 | call __LDIV__ 269 | pop EBX 270 | 271 | ret 16 272 | 273 | __alldiv endp 274 | 275 | ;; * Input 276 | ;; * [ESP+4] QWORD: dividend 277 | ;; * [ESP+12] QWORD: divisor 278 | ;; * Output 279 | ;; * [EDX,EAX] = remainder 280 | __allrem proc 281 | 282 | push EBX 283 | mov EAX,[ESP+8] 284 | mov EDX,[ESP+12] 285 | mov EBX,[ESP+16] 286 | mov ECX,[ESP+20] 287 | 288 | call __LDIV__ 289 | mov EAX, EBX 290 | mov EDX, ECX 291 | pop EBX 292 | 293 | ret 16 294 | 295 | __allrem endp 296 | 297 | ;; * Input 298 | ;; * [ESP+4] QWORD: dividend 299 | ;; * [ESP+12] QWORD: divisor 300 | ;; * Output 301 | ;; * [EDX,EAX] = quotient 302 | __aulldiv proc 303 | 304 | push EBX 305 | mov EAX,[ESP+8] 306 | mov EDX,[ESP+12] 307 | mov EBX,[ESP+16] 308 | mov ECX,[ESP+20] 309 | 310 | call __ULDIV__ 311 | pop EBX 312 | 313 | ret 16 314 | 315 | __aulldiv endp 316 | 317 | ;; * Input 318 | ;; * [ESP+4] QWORD: dividend 319 | ;; * [ESP+12] QWORD: divisor 320 | ;; * Output 321 | ;; * [EDX,EAX] = remainder 322 | __aullrem proc 323 | 324 | push EBX 325 | mov EAX,[ESP+8] 326 | mov EDX,[ESP+12] 327 | mov EBX,[ESP+16] 328 | mov ECX,[ESP+20] 329 | 330 | call __ULDIV__ 331 | mov EAX, EBX 332 | mov EDX, ECX 333 | pop EBX 334 | 335 | ret 16 336 | 337 | __aullrem endp 338 | 339 | _TEXT ends 340 | 341 | end 342 | -------------------------------------------------------------------------------- /msvcrt_atexit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef void(*_PVFV)(void); 4 | 5 | typedef struct atexit_node 6 | { 7 | struct atexit_node* next; 8 | _PVFV pfn; 9 | } atexit_node; 10 | 11 | static atexit_node* atexit_list; 12 | 13 | int atexit(_PVFV pfn) 14 | { 15 | atexit_node* node = malloc(sizeof(atexit_node)); 16 | if(!node) 17 | return -1; 18 | // TODO: not thread safe 19 | node->pfn = pfn; 20 | node->next = atexit_list; 21 | atexit_list = node; 22 | return 0; 23 | } 24 | 25 | void term_atexit() 26 | { 27 | while(atexit_list) 28 | { 29 | atexit_node* n = atexit_list; 30 | atexit_list = n->next; 31 | (*(n->pfn))(); 32 | free(n); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /msvcrt_data.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define _CRTALLOC(x) __declspec(allocate(x)) 5 | 6 | ULONG _tls_index = 0; 7 | 8 | #if MSVCRT_VERSION < 140 9 | #pragma section(".tls$AAA") 10 | #pragma section(".tls$ZZZ") 11 | #endif 12 | 13 | #pragma section(".CRT$XLA", long, read) 14 | #pragma section(".CRT$XLZ", long, read) 15 | #pragma section(".CRT$XIA", long, read) 16 | #pragma section(".CRT$XIZ", long, read) 17 | #pragma section(".CRT$XCA", long, read) 18 | #pragma section(".CRT$XCZ", long, read) 19 | #pragma section(".CRT$XPA", long, read) 20 | #pragma section(".CRT$XPZ", long, read) 21 | #pragma section(".CRT$XTA", long, read) 22 | #pragma section(".CRT$XTZ", long, read) 23 | #pragma section(".rdata$T", long, read) 24 | 25 | #pragma comment(linker, "/merge:.CRT=.rdata") 26 | 27 | #if MSVCRT_VERSION >= 140 // UCRT 28 | 29 | #pragma data_seg(".tls") 30 | #ifdef _M_X64 31 | _CRTALLOC(".tls") 32 | #endif 33 | char _tls_start = 0; 34 | 35 | #pragma data_seg(".tls$ZZZ") 36 | #ifdef _M_X64 37 | _CRTALLOC(".tls$ZZZ") 38 | #endif /* defined (_M_X64) */ 39 | char _tls_end = 0; 40 | 41 | #pragma data_seg() 42 | 43 | #else // MSVCRT_VERSION < 140 44 | 45 | /* TLS raw template data start and end. */ 46 | _CRTALLOC(".tls$AAA") int _tls_start = 0; 47 | _CRTALLOC(".tls$ZZZ") int _tls_end = 0; 48 | 49 | #endif 50 | 51 | // TLS init/exit callbacks 52 | _CRTALLOC(".CRT$XLA") PIMAGE_TLS_CALLBACK __xl_a = 0; 53 | _CRTALLOC(".CRT$XLZ") PIMAGE_TLS_CALLBACK __xl_z = 0; 54 | 55 | _CRTALLOC(".rdata$T") const IMAGE_TLS_DIRECTORY _tls_used = 56 | { 57 | (SIZE_T) &_tls_start, 58 | (SIZE_T) &_tls_end, 59 | (SIZE_T) &_tls_index, 60 | (SIZE_T) (&__xl_a+1), 61 | (ULONG) 0, // SizeOfZeroFill 62 | (ULONG) 0 // Characteristics 63 | }; 64 | 65 | typedef void(*_PVFV)(void); 66 | 67 | // C init 68 | _CRTALLOC(".CRT$XIA") _PVFV __xi_a[] = { NULL }; 69 | _CRTALLOC(".CRT$XIZ") _PVFV __xi_z[] = { NULL }; 70 | // C++ init 71 | _CRTALLOC(".CRT$XCA") _PVFV __xc_a[] = { NULL }; 72 | _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[] = { NULL }; 73 | // C pre-terminators 74 | _CRTALLOC(".CRT$XPA") _PVFV __xp_a[] = { NULL }; 75 | _CRTALLOC(".CRT$XPZ") _PVFV __xp_z[] = { NULL }; 76 | // C terminators 77 | _CRTALLOC(".CRT$XTA") _PVFV __xt_a[] = { NULL }; 78 | _CRTALLOC(".CRT$XTZ") _PVFV __xt_z[] = { NULL }; 79 | 80 | int _fltused = 0x9875; 81 | 82 | #ifdef _M_IX86 83 | // magic linker symbols available if the binary has a safe exception table 84 | // (implicit if all object files are safe-EH compatible) 85 | extern PVOID __safe_se_handler_table[]; 86 | extern BYTE __safe_se_handler_count; 87 | #endif 88 | 89 | const DECLSPEC_SELECTANY IMAGE_LOAD_CONFIG_DIRECTORY _load_config_used = 90 | { 91 | sizeof(_load_config_used), 92 | 0, 93 | 0, 94 | 0, 95 | 0, 96 | 0, 97 | 0, 98 | 0, 99 | 0, 100 | 0, 101 | 0, 102 | 0, 103 | 0, 104 | 0, 105 | 0, 106 | 0, 107 | 0, 108 | 0, 109 | #ifdef _M_IX86 110 | (SIZE_T) __safe_se_handler_table, 111 | (SIZE_T) &__safe_se_handler_count, 112 | #else 113 | 0, 114 | 0, 115 | #endif 116 | 0, 117 | 0, 118 | 0, 119 | 0, 120 | 0, 121 | }; 122 | -------------------------------------------------------------------------------- /msvcrt_stub.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define __UNKNOWN_APP 0 // abused for DLL 4 | #define __CONSOLE_APP 1 5 | #define __GUI_APP 2 6 | 7 | #ifndef _APPTYPE 8 | #define _APPTYPE __CONSOLE_APP 9 | #endif 10 | 11 | typedef void(*_PVFV)(); 12 | 13 | // C init 14 | extern _PVFV __xi_a[]; 15 | extern _PVFV __xi_z[]; 16 | // C++ init 17 | extern _PVFV __xc_a[]; 18 | extern _PVFV __xc_z[]; 19 | // C pre-terminators 20 | extern _PVFV __xp_a[]; 21 | extern _PVFV __xp_z[]; 22 | // C terminators 23 | extern _PVFV __xt_a[]; 24 | extern _PVFV __xt_z[]; 25 | 26 | extern void _setargv (void); 27 | extern void term_atexit(); 28 | 29 | extern IMAGE_DOS_HEADER __ImageBase; // linker generated 30 | 31 | extern int __ref_oldnames; 32 | 33 | #pragma comment(lib, "kernel32.lib") 34 | #pragma comment(lib, "oldnames.lib") 35 | #if MSVCRT_VERSION >= 140 36 | #pragma comment(lib, "ucrtbase.lib") 37 | #endif 38 | 39 | #if _APPTYPE == __UNKNOWN_APP 40 | 41 | extern BOOL WINAPI DllMain (HINSTANCE, DWORD, LPVOID); 42 | 43 | BOOL WINAPI 44 | _DllMainCRTStartup (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) 45 | { 46 | BOOL bRet; 47 | __ref_oldnames = 0; // drag in alternate definitions 48 | 49 | if (dwReason == DLL_PROCESS_ATTACH) 50 | { 51 | _initterm_e(__xi_a, __xi_z); 52 | _initterm(__xc_a, __xc_z); 53 | } 54 | 55 | bRet = DllMain (hDll, dwReason, lpReserved); 56 | 57 | if (dwReason == DLL_PROCESS_DETACH || dwReason == DLL_PROCESS_ATTACH && !bRet) 58 | { 59 | term_atexit(); 60 | _initterm(__xp_a, __xp_z); 61 | _initterm(__xt_a, __xt_z); 62 | } 63 | return bRet; 64 | } 65 | 66 | BOOL WINAPI __DefaultDllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) 67 | { 68 | return TRUE; 69 | } 70 | 71 | #ifdef _M_X64 72 | __pragma(comment(linker, "/alternatename:DllMain=__DefaultDllMain")); 73 | #else 74 | __pragma(comment(linker, "/alternatename:_DllMain@12=___DefaultDllMain@12")); 75 | #endif 76 | 77 | #else // _APPTYPE != __UNKNOWN_APP 78 | 79 | extern int __argc; 80 | 81 | #ifndef _UNICODE 82 | extern char **__argv; 83 | extern int main(int, char **, char **); 84 | #else 85 | extern wchar_t **__wargv; 86 | extern int wmain(int, wchar_t **, wchar_t **); 87 | #endif 88 | 89 | #if MSVCRT_VERSION >= 140 // UCRT 90 | 91 | #ifdef _M_X64 92 | __pragma(comment(linker, "/alternatename:__set_app_type=_set_app_type")); 93 | #else 94 | __pragma(comment(linker, "/alternatename:___set_app_type=__set_app_type")); 95 | #endif 96 | 97 | enum _crt_argv_mode 98 | { 99 | _crt_argv_no_arguments, 100 | _crt_argv_unexpanded_arguments, 101 | _crt_argv_expanded_arguments, 102 | }; 103 | 104 | #ifndef _UNICODE 105 | extern int _initialize_narrow_environment(); 106 | extern char **_get_initial_narrow_environment(); 107 | extern int _configure_narrow_argv(int); 108 | extern char *_get_narrow_winmain_command_line(); 109 | #else // _UNICODE 110 | extern int _initialize_wide_environment(); 111 | extern wchar_t **_get_initial_wide_environment(); 112 | extern int _configure_wide_argv(int); 113 | extern wchar_t *_get_wide_winmain_command_line(); 114 | #endif 115 | 116 | #else // MSVCRT_VERSION < 140 117 | 118 | /* In MSVCRT.DLL, Microsoft's initialization hook is called __getmainargs(), 119 | * and it expects a further structure argument, (which we don't use, but pass 120 | * it as a dummy, with a declared size of zero in its first and only field). 121 | */ 122 | typedef struct _startupinfo { int mode; } _startupinfo; 123 | #ifndef _UNICODE 124 | extern int __getmainargs(int *argc, char ***argv, char ***penv, int glob, _startupinfo *info); 125 | #else 126 | extern int __wgetmainargs(int *argc, wchar_t ***argv, wchar_t ***penv, int glob, _startupinfo *info); 127 | #endif 128 | 129 | #endif // MSVCRT_VERSION < 140 130 | 131 | /* The function mainCRTStartup() is the entry point for all 132 | * console/desktop programs. 133 | */ 134 | #if _APPTYPE == __CONSOLE_APP 135 | #ifndef _UNICODE 136 | void mainCRTStartup(void) 137 | #else 138 | void wmainCRTStartup(void) 139 | #endif 140 | #else // desktop app 141 | #ifndef _UNICODE 142 | void WinMainCRTStartup(void) 143 | #else 144 | void wWinMainCRTStartup(void) 145 | #endif 146 | #endif 147 | { 148 | int nRet; 149 | __set_app_type(_APPTYPE); 150 | __ref_oldnames = 0; // drag in alternate definitions 151 | 152 | #if MSVCRT_VERSION >= 140 // UCRT 153 | #ifndef _UNICODE 154 | _configure_narrow_argv(_crt_argv_unexpanded_arguments); 155 | _initialize_narrow_environment(); 156 | char **envp = _get_initial_narrow_environment(); 157 | #else 158 | _configure_wide_argv(_crt_argv_unexpanded_arguments); 159 | _initialize_wide_environment(); 160 | wchar_t **wenvp = _get_initial_wide_environment(); 161 | #endif 162 | #else // MSVCRT_VERSION < 140 163 | /* The MSVCRT.DLL start-up hook requires this invocation 164 | * protocol... 165 | */ 166 | _startupinfo start_info = { 0 }; 167 | #ifndef _UNICODE 168 | char **envp = NULL; 169 | __getmainargs(&__argc, &__argv, &envp, 0, &start_info); 170 | #else 171 | wchar_t **wenvp = NULL; 172 | __wgetmainargs(&__argc, &__wargv, &wenvp, 0, &start_info); 173 | #endif 174 | #endif // MSVCRT_VERSION < 140 175 | 176 | _initterm_e(__xi_a, __xi_z); 177 | _initterm(__xc_a, __xc_z); 178 | 179 | #if _APPTYPE == __CONSOLE_APP 180 | #ifndef _UNICODE 181 | nRet = main(__argc, __argv, envp); 182 | #else 183 | nRet = wmain(__argc, __wargv, wenvp); 184 | #endif 185 | #else // desktop app 186 | { 187 | STARTUPINFOA startupInfo; 188 | GetStartupInfoA(&startupInfo); 189 | int showWindowMode = startupInfo.dwFlags & STARTF_USESHOWWINDOW 190 | ? startupInfo.wShowWindow : SW_SHOWDEFAULT; 191 | #ifndef _UNICODE 192 | #if MSVCRT_VERSION >= 140 // UCRT 193 | LPSTR lpszCommandLine = _get_narrow_winmain_command_line(); 194 | #else 195 | LPSTR lpszCommandLine = GetCommandLineA(); 196 | #endif 197 | nRet = WinMain((HINSTANCE)&__ImageBase, NULL, lpszCommandLine, showWindowMode); 198 | #else // _UNICODE 199 | #if MSVCRT_VERSION >= 140 // UCRT 200 | LPWSTR lpszCommandLine = _get_wide_winmain_command_line(); 201 | #else 202 | LPWSTR lpszCommandLine = GetCommandLineW(); 203 | #endif 204 | nRet = wWinMain((HINSTANCE)&__ImageBase, NULL, lpszCommandLine, showWindowMode); 205 | #endif 206 | } 207 | #endif // desktop app 208 | 209 | term_atexit(); 210 | _initterm(__xp_a, __xp_z); 211 | _initterm(__xt_a, __xt_z); 212 | 213 | ExitProcess(nRet); 214 | } 215 | 216 | #endif // _APPTYPE != __UNKNOWN_APP 217 | -------------------------------------------------------------------------------- /oldnames.aliases32: -------------------------------------------------------------------------------- 1 | ; aliases extracted from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\oldnames.lib 2 | __imp__utime=__imp___utime32 3 | _utime=__utime32 4 | __imp__ftime=__imp___ftime32 5 | _ftime=__ftime32 6 | __imp__stat=__imp___stat32 7 | _stat=__stat32 8 | __imp__fstat=__imp___fstat32 9 | _fstat=__fstat32 10 | __imp__fcloseall=__imp___fcloseall 11 | _fcloseall=__fcloseall 12 | __imp__control87=__imp___control87 13 | _control87=__control87 14 | __imp__sys_errlist=__imp___sys_errlist 15 | _sys_errlist=__sys_errlist 16 | __imp__filelength=__imp___filelength 17 | _filelength=__filelength 18 | __imp__strcmpi=__imp___stricmp 19 | _strcmpi=__stricmp 20 | __imp__wcsicoll=__imp___wcsicoll 21 | __imp__wcsupr=__imp___wcsupr 22 | __imp__wcslwr=__imp___wcslwr 23 | __imp__wcsset=__imp___wcsset 24 | __imp__wcsrev=__imp___wcsrev 25 | __imp__wcsnset=__imp___wcsnset 26 | __imp__wcsnicmp=__imp___wcsnicmp 27 | __imp__wcsicmp=__imp___wcsicmp 28 | __imp__wcsdup=__imp___wcsdup 29 | __imp__dup=__imp___dup 30 | __imp__tzset=__imp___tzset 31 | __imp__tzname=__imp___tzname 32 | __imp__timezone=__imp___timezone 33 | __imp__strupr=__imp___strupr 34 | __imp__strset=__imp___strset 35 | __imp__strrev=__imp___strrev 36 | __imp__strnset=__imp___strnset 37 | __imp__strnicmp=__imp___strnicmp 38 | __imp__strlwr=__imp___strlwr 39 | __imp__strdup=__imp___strdup 40 | __imp__stricmp=__imp___stricmp 41 | __imp__tempnam=__imp___tempnam 42 | __imp__rmtmp=__imp___rmtmp 43 | __imp__putw=__imp___putw 44 | __imp__getw=__imp___getw 45 | __imp__fputchar=__imp___fputchar 46 | __imp__flushall=__imp___flushall 47 | __imp__fileno=__imp___fileno 48 | __imp__fgetchar=__imp___fgetchar 49 | __imp__fdopen=__imp___fdopen 50 | __imp__ultoa=__imp___ultoa 51 | __imp__swab=__imp___swab 52 | __imp__putenv=__imp___putenv 53 | __imp__onexit=__imp___onexit 54 | __imp__ltoa=__imp___ltoa 55 | __imp__itoa=__imp___itoa 56 | __imp__yn=__imp___yn 57 | __imp__y1=__imp___y1 58 | __imp__y0=__imp___y0 59 | __imp__jn=__imp___jn 60 | __imp__j1=__imp___j1 61 | __imp__j0=__imp___j0 62 | __imp__cabs=__imp___cabs 63 | __imp__HUGE=__imp___HUGE 64 | __imp__gcvt=__imp___gcvt 65 | __imp__fcvt=__imp___fcvt 66 | __imp__ecvt=__imp___ecvt 67 | __imp__lsearch=__imp___lsearch 68 | __imp__lfind=__imp___lfind 69 | __imp__spawnvpe=__imp___spawnvpe 70 | __imp__spawnvp=__imp___spawnvp 71 | __imp__spawnve=__imp___spawnve 72 | __imp__spawnv=__imp___spawnv 73 | __imp__spawnlpe=__imp___spawnlpe 74 | __imp__spawnlp=__imp___spawnlp 75 | __imp__spawnle=__imp___spawnle 76 | __imp__spawnl=__imp___spawnl 77 | __imp__getpid=__imp___getpid 78 | __imp__execvpe=__imp___execvpe 79 | __imp__execvp=__imp___execvp 80 | __imp__execve=__imp___execve 81 | __imp__execv=__imp___execv 82 | __imp__execlpe=__imp___execlpe 83 | __imp__execlp=__imp___execlp 84 | __imp__execle=__imp___execle 85 | __imp__execl=__imp___execl 86 | __imp__cwait=__imp___cwait 87 | __imp__memicmp=__imp___memicmp 88 | __imp__memccpy=__imp___memccpy 89 | __imp__write=__imp___write 90 | __imp__unlink=__imp___unlink 91 | __imp__umask=__imp___umask 92 | __imp__tell=__imp___tell 93 | __imp__sys_nerr=__imp___sys_nerr 94 | __imp__sopen=__imp___sopen 95 | __imp__setmode=__imp___setmode 96 | __imp__read=__imp___read 97 | __imp__open=__imp___open 98 | __imp__mktemp=__imp___mktemp 99 | __imp__lseek=__imp___lseek 100 | __imp__locking=__imp___locking 101 | __imp__isatty=__imp___isatty 102 | __imp__eof=__imp___eof 103 | __imp__dup2=__imp___dup2 104 | __imp__creat=__imp___creat 105 | __imp__close=__imp___close 106 | __imp__chsize=__imp___chsize 107 | __imp__chmod=__imp___chmod 108 | __imp__access=__imp___access 109 | __imp__rmdir=__imp___rmdir 110 | __imp__mkdir=__imp___mkdir 111 | __imp__getcwd=__imp___getcwd 112 | __imp__chdir=__imp___chdir 113 | __imp__ungetch=__imp___ungetch 114 | __imp__putch=__imp___putch 115 | __imp__kbhit=__imp___kbhit 116 | __imp__getche=__imp___getche 117 | __imp__fpreset=__imp___fpreset 118 | __imp__getch=__imp___getch 119 | __imp__environ=__imp___environ 120 | __imp__daylight=__imp___daylight 121 | __imp__cscanf=__imp___cscanf 122 | __imp__cputs=__imp___cputs 123 | __imp__cprintf=__imp___cprintf 124 | __imp__cgets=__imp___cgets 125 | _wcsicoll=__wcsicoll 126 | _wcsupr=__wcsupr 127 | _wcslwr=__wcslwr 128 | _wcsset=__wcsset 129 | _wcsrev=__wcsrev 130 | _wcsnset=__wcsnset 131 | _wcsnicmp=__wcsnicmp 132 | _wcsicmp=__wcsicmp 133 | _wcsdup=__wcsdup 134 | _dup=__dup 135 | _tzset=__tzset 136 | _tzname=__tzname 137 | _timezone=__timezone 138 | _strupr=__strupr 139 | _strset=__strset 140 | _strrev=__strrev 141 | _strnset=__strnset 142 | _strnicmp=__strnicmp 143 | _strlwr=__strlwr 144 | _strdup=__strdup 145 | _stricmp=__stricmp 146 | _tempnam=__tempnam 147 | _rmtmp=__rmtmp 148 | _putw=__putw 149 | _getw=__getw 150 | _fputchar=__fputchar 151 | _flushall=__flushall 152 | _fileno=__fileno 153 | _fgetchar=__fgetchar 154 | _fdopen=__fdopen 155 | _ultoa=__ultoa 156 | _swab=__swab 157 | _putenv=__putenv 158 | _onexit=__onexit 159 | _ltoa=__ltoa 160 | _itoa=__itoa 161 | _yn=__yn 162 | _y1=__y1 163 | _y0=__y0 164 | _jn=__jn 165 | _j1=__j1 166 | _j0=__j0 167 | _cabs=__cabs 168 | _HUGE=__HUGE 169 | _gcvt=__gcvt 170 | _fcvt=__fcvt 171 | _ecvt=__ecvt 172 | _lsearch=__lsearch 173 | _lfind=__lfind 174 | _spawnvpe=__spawnvpe 175 | _spawnvp=__spawnvp 176 | _spawnve=__spawnve 177 | _spawnv=__spawnv 178 | _spawnlpe=__spawnlpe 179 | _spawnlp=__spawnlp 180 | _spawnle=__spawnle 181 | _spawnl=__spawnl 182 | _getpid=__getpid 183 | _execvpe=__execvpe 184 | _execvp=__execvp 185 | _execve=__execve 186 | _execv=__execv 187 | _execlpe=__execlpe 188 | _execlp=__execlp 189 | _execle=__execle 190 | _execl=__execl 191 | _cwait=__cwait 192 | _memicmp=__memicmp 193 | _memccpy=__memccpy 194 | _write=__write 195 | _unlink=__unlink 196 | _umask=__umask 197 | _tell=__tell 198 | _sys_nerr=__sys_nerr 199 | _sopen=__sopen 200 | _setmode=__setmode 201 | _read=__read 202 | _open=__open 203 | _mktemp=__mktemp 204 | _lseek=__lseek 205 | _locking=__locking 206 | _isatty=__isatty 207 | _eof=__eof 208 | _dup2=__dup2 209 | _creat=__creat 210 | _close=__close 211 | _chsize=__chsize 212 | _chmod=__chmod 213 | _access=__access 214 | _rmdir=__rmdir 215 | _mkdir=__mkdir 216 | _getcwd=__getcwd 217 | _chdir=__chdir 218 | _ungetch=__ungetch 219 | _putch=__putch 220 | _kbhit=__kbhit 221 | _getche=__getche 222 | _fpreset=__fpreset 223 | _getch=__getch 224 | _environ=__environ 225 | _daylight=__daylight 226 | _cscanf=__cscanf 227 | _cputs=__cputs 228 | _cprintf=__cprintf 229 | _cgets=__cgets 230 | -------------------------------------------------------------------------------- /oldnames.aliases64: -------------------------------------------------------------------------------- 1 | ; aliases extracted from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\oldnames.lib 2 | __imp_utime=__imp__utime32 3 | utime=_utime32 4 | __imp_ftime=__imp__ftime32 5 | ftime=_ftime32 6 | __imp_stat=__imp__stat32 7 | stat=_stat32 8 | __imp_fstat=__imp__fstat32 9 | fstat=_fstat32 10 | __imp_fcloseall=__imp__fcloseall 11 | fcloseall=_fcloseall 12 | __imp_control87=__imp__control87 13 | control87=_control87 14 | __imp_sys_errlist=__imp__sys_errlist 15 | sys_errlist=_sys_errlist 16 | __imp_filelength=__imp__filelength 17 | filelength=_filelength 18 | __imp_strcmpi=__imp__stricmp 19 | strcmpi=_stricmp 20 | __imp_wcsicoll=__imp__wcsicoll 21 | __imp_wcsupr=__imp__wcsupr 22 | __imp_wcslwr=__imp__wcslwr 23 | __imp_wcsset=__imp__wcsset 24 | __imp_wcsrev=__imp__wcsrev 25 | __imp_wcsnset=__imp__wcsnset 26 | __imp_wcsnicmp=__imp__wcsnicmp 27 | __imp_wcsicmp=__imp__wcsicmp 28 | __imp_wcsdup=__imp__wcsdup 29 | __imp_dup=__imp__dup 30 | __imp_tzset=__imp__tzset 31 | __imp_tzname=__imp__tzname 32 | __imp_timezone=__imp__timezone 33 | __imp_strupr=__imp__strupr 34 | __imp_strset=__imp__strset 35 | __imp_strrev=__imp__strrev 36 | __imp_strnset=__imp__strnset 37 | __imp_strnicmp=__imp__strnicmp 38 | __imp_strlwr=__imp__strlwr 39 | __imp_strdup=__imp__strdup 40 | __imp_stricmp=__imp__stricmp 41 | __imp_tempnam=__imp__tempnam 42 | __imp_rmtmp=__imp__rmtmp 43 | __imp_putw=__imp__putw 44 | __imp_getw=__imp__getw 45 | __imp_fputchar=__imp__fputchar 46 | __imp_flushall=__imp__flushall 47 | __imp_fileno=__imp__fileno 48 | __imp_fgetchar=__imp__fgetchar 49 | __imp_fdopen=__imp__fdopen 50 | __imp_ultoa=__imp__ultoa 51 | __imp_swab=__imp__swab 52 | __imp_putenv=__imp__putenv 53 | __imp_onexit=__imp__onexit 54 | __imp_ltoa=__imp__ltoa 55 | __imp_itoa=__imp__itoa 56 | __imp_yn=__imp__yn 57 | __imp_y1=__imp__y1 58 | __imp_y0=__imp__y0 59 | __imp_jn=__imp__jn 60 | __imp_j1=__imp__j1 61 | __imp_j0=__imp__j0 62 | __imp_cabs=__imp__cabs 63 | __imp_HUGE=__imp__HUGE 64 | __imp_gcvt=__imp__gcvt 65 | __imp_fcvt=__imp__fcvt 66 | __imp_ecvt=__imp__ecvt 67 | __imp_lsearch=__imp__lsearch 68 | __imp_lfind=__imp__lfind 69 | __imp_spawnvpe=__imp__spawnvpe 70 | __imp_spawnvp=__imp__spawnvp 71 | __imp_spawnve=__imp__spawnve 72 | __imp_spawnv=__imp__spawnv 73 | __imp_spawnlpe=__imp__spawnlpe 74 | __imp_spawnlp=__imp__spawnlp 75 | __imp_spawnle=__imp__spawnle 76 | __imp_spawnl=__imp__spawnl 77 | __imp_getpid=__imp__getpid 78 | __imp_execvpe=__imp__execvpe 79 | __imp_execvp=__imp__execvp 80 | __imp_execve=__imp__execve 81 | __imp_execv=__imp__execv 82 | __imp_execlpe=__imp__execlpe 83 | __imp_execlp=__imp__execlp 84 | __imp_execle=__imp__execle 85 | __imp_execl=__imp__execl 86 | __imp_cwait=__imp__cwait 87 | __imp_memicmp=__imp__memicmp 88 | __imp_memccpy=__imp__memccpy 89 | __imp_write=__imp__write 90 | __imp_unlink=__imp__unlink 91 | __imp_umask=__imp__umask 92 | __imp_tell=__imp__tell 93 | __imp_sys_nerr=__imp__sys_nerr 94 | __imp_sopen=__imp__sopen 95 | __imp_setmode=__imp__setmode 96 | __imp_read=__imp__read 97 | __imp_open=__imp__open 98 | __imp_mktemp=__imp__mktemp 99 | __imp_lseek=__imp__lseek 100 | __imp_locking=__imp__locking 101 | __imp_isatty=__imp__isatty 102 | __imp_eof=__imp__eof 103 | __imp_dup2=__imp__dup2 104 | __imp_creat=__imp__creat 105 | __imp_close=__imp__close 106 | __imp_chsize=__imp__chsize 107 | __imp_chmod=__imp__chmod 108 | __imp_access=__imp__access 109 | __imp_rmdir=__imp__rmdir 110 | __imp_mkdir=__imp__mkdir 111 | __imp_getcwd=__imp__getcwd 112 | __imp_chdir=__imp__chdir 113 | __imp_ungetch=__imp__ungetch 114 | __imp_putch=__imp__putch 115 | __imp_kbhit=__imp__kbhit 116 | __imp_getche=__imp__getche 117 | __imp_fpreset=__imp__fpreset 118 | __imp_getch=__imp__getch 119 | __imp_environ=__imp__environ 120 | __imp_daylight=__imp__daylight 121 | __imp_cscanf=__imp__cscanf 122 | __imp_cputs=__imp__cputs 123 | __imp_cprintf=__imp__cprintf 124 | __imp_cgets=__imp__cgets 125 | wcsicoll=_wcsicoll 126 | wcsupr=_wcsupr 127 | wcslwr=_wcslwr 128 | wcsset=_wcsset 129 | wcsrev=_wcsrev 130 | wcsnset=_wcsnset 131 | wcsnicmp=_wcsnicmp 132 | wcsicmp=_wcsicmp 133 | wcsdup=_wcsdup 134 | dup=_dup 135 | tzset=_tzset 136 | tzname=_tzname 137 | timezone=_timezone 138 | strupr=_strupr 139 | strset=_strset 140 | strrev=_strrev 141 | strnset=_strnset 142 | strnicmp=_strnicmp 143 | strlwr=_strlwr 144 | strdup=_strdup 145 | stricmp=_stricmp 146 | tempnam=_tempnam 147 | rmtmp=_rmtmp 148 | putw=_putw 149 | getw=_getw 150 | fputchar=_fputchar 151 | flushall=_flushall 152 | fileno=_fileno 153 | fgetchar=_fgetchar 154 | fdopen=_fdopen 155 | ultoa=_ultoa 156 | swab=_swab 157 | putenv=_putenv 158 | onexit=_onexit 159 | ltoa=_ltoa 160 | itoa=_itoa 161 | yn=_yn 162 | y1=_y1 163 | y0=_y0 164 | jn=_jn 165 | j1=_j1 166 | j0=_j0 167 | cabs=_cabs 168 | HUGE=_HUGE 169 | gcvt=_gcvt 170 | fcvt=_fcvt 171 | ecvt=_ecvt 172 | lsearch=_lsearch 173 | lfind=_lfind 174 | spawnvpe=_spawnvpe 175 | spawnvp=_spawnvp 176 | spawnve=_spawnve 177 | spawnv=_spawnv 178 | spawnlpe=_spawnlpe 179 | spawnlp=_spawnlp 180 | spawnle=_spawnle 181 | spawnl=_spawnl 182 | getpid=_getpid 183 | execvpe=_execvpe 184 | execvp=_execvp 185 | execve=_execve 186 | execv=_execv 187 | execlpe=_execlpe 188 | execlp=_execlp 189 | execle=_execle 190 | execl=_execl 191 | cwait=_cwait 192 | memicmp=_memicmp 193 | memccpy=_memccpy 194 | write=_write 195 | unlink=_unlink 196 | umask=_umask 197 | tell=_tell 198 | sys_nerr=_sys_nerr 199 | sopen=_sopen 200 | setmode=_setmode 201 | read=_read 202 | open=_open 203 | mktemp=_mktemp 204 | lseek=_lseek 205 | locking=_locking 206 | isatty=_isatty 207 | eof=_eof 208 | dup2=_dup2 209 | creat=_creat 210 | close=_close 211 | chsize=_chsize 212 | chmod=_chmod 213 | access=_access 214 | rmdir=_rmdir 215 | mkdir=_mkdir 216 | getcwd=_getcwd 217 | chdir=_chdir 218 | ungetch=_ungetch 219 | putch=_putch 220 | kbhit=_kbhit 221 | getche=_getche 222 | fpreset=_fpreset 223 | getch=_getch 224 | environ=_environ 225 | daylight=_daylight 226 | cscanf=_cscanf 227 | cputs=_cputs 228 | cprintf=_cprintf 229 | cgets=_cgets 230 | --------------------------------------------------------------------------------