From a4b3e695af47a93788b265b0fc4a55d4dded1ef3 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 9 Oct 2019 17:08:07 +0200 Subject: [PATCH 01/41] Shuffle around some stack-probing functions --- lib/std/special/compiler_rt.zig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig index 902f2da2ff..ec703afc9f 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -234,14 +234,16 @@ comptime { @export("__aeabi_dcmpun", @import("compiler_rt/comparedf2.zig").__unorddf2, linkage); } if (builtin.os == .windows) { - if (!builtin.link_libc) { + // Default stack-probe functions emitted by LLVM + if (is_mingw) { + @export("_alloca", @import("compiler_rt/stack_probe.zig")._chkstk, strong_linkage); + @export("___chkstk_ms", @import("compiler_rt/stack_probe.zig").___chkstk_ms, strong_linkage); + } else { @export("_chkstk", @import("compiler_rt/stack_probe.zig")._chkstk, strong_linkage); @export("__chkstk", @import("compiler_rt/stack_probe.zig").__chkstk, strong_linkage); - @export("___chkstk", @import("compiler_rt/stack_probe.zig").___chkstk, strong_linkage); - @export("__chkstk_ms", @import("compiler_rt/stack_probe.zig").__chkstk_ms, strong_linkage); - @export("___chkstk_ms", @import("compiler_rt/stack_probe.zig").___chkstk_ms, strong_linkage); - } else if (is_mingw) { - @export("___chkstk_ms", @import("compiler_rt/stack_probe.zig").___chkstk_ms, strong_linkage); + } + + if (is_mingw) { @export("__stack_chk_fail", __stack_chk_fail, strong_linkage); @export("__stack_chk_guard", __stack_chk_guard, strong_linkage); } From f83bb3dd9e68899ca39cdddb7d84c2ad1c833d55 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 9 Oct 2019 22:02:37 +0200 Subject: [PATCH 02/41] Fix compilation w/ clang Clang pretends to be gcc 4.4 and that causes some re-definition errors. The problem has been reported to the upstream some time ago but nothing was done about it. --- lib/libc/include/any-windows-any/intrin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/include/any-windows-any/intrin.h b/lib/libc/include/any-windows-any/intrin.h index 0b2343fb87..8fe46c20ee 100644 --- a/lib/libc/include/any-windows-any/intrin.h +++ b/lib/libc/include/any-windows-any/intrin.h @@ -50,7 +50,7 @@ * On GCC 4.9 we may always include those headers. On older GCCs, we may do it only if CPU * features used by them are enabled, so we need to check macros like __SSE__ or __MMX__ first. */ -#if __MINGW_GNUC_PREREQ(4, 9) +#if __MINGW_GNUC_PREREQ(4, 9) || defined(__clang__) #define __MINGW_FORCE_SYS_INTRINS #endif From 9ae293ae3bda918280a9ee254685ec9468e7d141 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 9 Oct 2019 22:07:05 +0200 Subject: [PATCH 03/41] Remove x86/Windows name mangling hack Let's fix this properly by generating the correct lib files from the mingw sources. --- lib/std/special/compiler_rt.zig | 10 ++++++---- src/codegen.cpp | 8 -------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig index ec703afc9f..88e3078d6a 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -250,10 +250,12 @@ comptime { switch (builtin.arch) { .i386 => { - @export("_alldiv", @import("compiler_rt/aulldiv.zig")._alldiv, strong_linkage); - @export("_aulldiv", @import("compiler_rt/aulldiv.zig")._aulldiv, strong_linkage); - @export("_allrem", @import("compiler_rt/aullrem.zig")._allrem, strong_linkage); - @export("_aullrem", @import("compiler_rt/aullrem.zig")._aullrem, strong_linkage); + // Don't let LLVM apply the stdcall name mangling on those MSVC + // builtin functions + @export("\x01__alldiv", @import("compiler_rt/aulldiv.zig")._alldiv, strong_linkage); + @export("\x01__aulldiv", @import("compiler_rt/aulldiv.zig")._aulldiv, strong_linkage); + @export("\x01__allrem", @import("compiler_rt/aullrem.zig")._allrem, strong_linkage); + @export("\x01__aullrem", @import("compiler_rt/aullrem.zig")._aullrem, strong_linkage); @export("__divti3", @import("compiler_rt/divti3.zig").__divti3, linkage); @export("__modti3", @import("compiler_rt/modti3.zig").__modti3, linkage); diff --git a/src/codegen.cpp b/src/codegen.cpp index fdc67b4dd6..055a66792e 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -415,16 +415,8 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) { bool external_linkage = linkage != GlobalLinkageIdInternal; CallingConvention cc = fn->type_entry->data.fn.fn_type_id.cc; - if (cc == CallingConventionStdcall && external_linkage && - g->zig_target->arch == ZigLLVM_x86) - { - // prevent llvm name mangling - symbol_name = buf_ptr(buf_sprintf("\x01_%s", symbol_name)); - } - bool is_async = fn_is_async(fn); - ZigType *fn_type = fn->type_entry; // Make the raw_type_ref populated resolve_llvm_types_fn(g, fn); From b96fa894625fc1aeb5f381dd52d291a6fc170fd1 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 9 Oct 2019 22:08:49 +0200 Subject: [PATCH 04/41] Compile the architecture-specific mingw sources --- src/link.cpp | 101 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/src/link.cpp b/src/link.cpp index cf473b8cd7..1310210cba 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -552,28 +552,22 @@ static const char *mingwex_arm64_src[] = { struct MinGWDef { const char *name; - const char *path; bool always_link; }; static const MinGWDef mingw_def_list[] = { - {"msvcrt", "lib-common" OS_SEP "msvcrt.def.in", true}, - {"setupapi", "libarm32" OS_SEP "setupapi.def", false}, - {"setupapi", "libarm64" OS_SEP "setupapi.def", false}, - {"setupapi", "lib32" OS_SEP "setupapi.def", false}, - {"setupapi", "lib64" OS_SEP "setupapi.def", false}, - {"winmm", "lib-common" OS_SEP "winmm.def", false}, - {"gdi32", "lib-common" OS_SEP "gdi32.def", false}, - {"imm32", "lib-common" OS_SEP "imm32.def", false}, - {"version", "lib-common" OS_SEP "version.def", false}, - {"advapi32", "lib-common" OS_SEP "advapi32.def.in", true}, - {"oleaut32", "lib-common" OS_SEP "oleaut32.def.in", false}, - {"ole32", "lib-common" OS_SEP "ole32.def.in", false}, - {"shell32", "lib-common" OS_SEP "shell32.def", true}, - {"user32", "lib-common" OS_SEP "user32.def.in", true}, - {"kernel32", "lib-common" OS_SEP "kernel32.def.in", true}, - {"ntdll", "libarm32" OS_SEP "ntdll.def", true}, - {"ntdll", "lib32" OS_SEP "ntdll.def", true}, - {"ntdll", "lib64" OS_SEP "ntdll.def", true}, + {"advapi32",true}, + {"gdi32", false}, + {"imm32", false}, + {"kernel32",true}, + {"msvcrt", true}, + {"ntdll", true}, + {"ole32", false}, + {"oleaut32",false}, + {"setupapi",false}, + {"shell32", true}, + {"user32", true}, + {"version", false}, + {"winmm", false}, }; struct LinkJob { @@ -1955,7 +1949,7 @@ static void print_zig_cc_cmd(ZigList *args) { fprintf(stderr, "\n"); } -static const char *get_def_lib(CodeGen *parent, const char *name, Buf *def_in_rel_path) { +static const char *get_def_lib(CodeGen *parent, const char *name, Buf *def_in_file) { Error err; Buf *self_exe_path = buf_alloc(); @@ -1973,8 +1967,6 @@ static const char *get_def_lib(CodeGen *parent, const char *name, Buf *def_in_re Buf *o_dir = buf_sprintf("%s" OS_SEP CACHE_OUT_SUBDIR, buf_ptr(cache_dir)); Buf *manifest_dir = buf_sprintf("%s" OS_SEP CACHE_HASH_SUBDIR, buf_ptr(cache_dir)); - Buf *def_in_file = buf_sprintf("%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "%s", - buf_ptr(parent->zig_lib_dir), buf_ptr(def_in_rel_path)); Buf *def_include_dir = buf_sprintf("%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "def-include", buf_ptr(parent->zig_lib_dir)); @@ -2122,24 +2114,57 @@ static void add_mingw_link_args(LinkJob *lj, bool is_library) { for (size_t def_i = 0; def_i < array_length(mingw_def_list); def_i += 1) { const char *name = mingw_def_list[def_i].name; - Buf *path = buf_create_from_str(mingw_def_list[def_i].path); - bool always_link = mingw_def_list[def_i].always_link; - bool is_this_arch = false; - if (buf_starts_with_str(path, "lib-common" OS_SEP)) { - is_this_arch = true; - } else if (target_is_arm(g->zig_target)) { - if (target_arch_pointer_bit_width(g->zig_target->arch) == 32) { - is_this_arch = buf_starts_with_str(path, "libarm32" OS_SEP); - } else { - is_this_arch = buf_starts_with_str(path, "libarm64" OS_SEP); - } - } else if (g->zig_target->arch == ZigLLVM_x86) { - is_this_arch = buf_starts_with_str(path, "lib32" OS_SEP); + const bool always_link = mingw_def_list[def_i].always_link; + + Buf override_path = BUF_INIT; + + char const *lib_path = nullptr; + if (g->zig_target->arch == ZigLLVM_x86) { + lib_path = "lib32"; } else if (g->zig_target->arch == ZigLLVM_x86_64) { - is_this_arch = buf_starts_with_str(path, "lib64" OS_SEP); + lib_path = "lib64"; + } else if (target_is_arm(g->zig_target)) { + const bool is_32 = target_arch_pointer_bit_width(g->zig_target->arch) == 32; + lib_path = is_32 ? "libarm32" : "libarm64"; + } else { + zig_unreachable(); } - if (is_this_arch && (always_link || is_linking_system_lib(g, name))) { - lj->args.append(get_def_lib(g, name, path)); + + // Try the archtecture-specific path first + buf_resize(&override_path, 0); + buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "%s" OS_SEP "%s.def", buf_ptr(g->zig_lib_dir), lib_path, name); + + bool does_exist; + if (os_file_exists(&override_path, &does_exist) != ErrorNone) { + zig_panic("link: unable to check if file exists: %s", buf_ptr(&override_path)); + } + + if (!does_exist) { + // Try the generic version + buf_resize(&override_path, 0); + buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "lib-common" OS_SEP "%s.def", buf_ptr(g->zig_lib_dir), name); + + if (os_file_exists(&override_path, &does_exist) != ErrorNone) { + zig_panic("link: unable to check if file exists: %s", buf_ptr(&override_path)); + } + } + + if (!does_exist) { + // Try the generic version and preprocess it + buf_resize(&override_path, 0); + buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "lib-common" OS_SEP "%s.def.in", buf_ptr(g->zig_lib_dir), name); + + if (os_file_exists(&override_path, &does_exist) != ErrorNone) { + zig_panic("link: unable to check if file exists: %s", buf_ptr(&override_path)); + } + } + + if (!does_exist) { + zig_panic("link: could not find .def file to build %s\n", name); + } + + if (always_link || is_linking_system_lib(g, name)) { + lj->args.append(get_def_lib(g, name, &override_path)); } } } From c9a3c945dbc8d431fa5bdaf672401c312ead480f Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 9 Oct 2019 22:09:58 +0200 Subject: [PATCH 05/41] Add a bunch of mingw lib32 .def files Possibly incomplete, but enough to let the test suite compile & pass. --- lib/libc/mingw/lib32/advapi32.def | 823 ++++++++++++++ lib/libc/mingw/lib32/gdi32.def | 376 +++++++ lib/libc/mingw/lib32/imm32.def | 136 +++ lib/libc/mingw/lib32/kernel32.def | 1660 +++++++++++++++++++++++++++++ lib/libc/mingw/lib32/ole32.def | 405 +++++++ lib/libc/mingw/lib32/oleaut32.def | 427 ++++++++ lib/libc/mingw/lib32/shell32.def | 356 +++++++ lib/libc/mingw/lib32/winmm.def | 196 ++++ 8 files changed, 4379 insertions(+) create mode 100644 lib/libc/mingw/lib32/advapi32.def create mode 100644 lib/libc/mingw/lib32/gdi32.def create mode 100644 lib/libc/mingw/lib32/imm32.def create mode 100644 lib/libc/mingw/lib32/kernel32.def create mode 100644 lib/libc/mingw/lib32/ole32.def create mode 100644 lib/libc/mingw/lib32/oleaut32.def create mode 100644 lib/libc/mingw/lib32/shell32.def create mode 100644 lib/libc/mingw/lib32/winmm.def diff --git a/lib/libc/mingw/lib32/advapi32.def b/lib/libc/mingw/lib32/advapi32.def new file mode 100644 index 0000000000..91076556d9 --- /dev/null +++ b/lib/libc/mingw/lib32/advapi32.def @@ -0,0 +1,823 @@ +; +; Definition file of ADVAPI32.dll +; Automatic generated by gendef +; written by Kai Tietz 2008 +; +LIBRARY "ADVAPI32.dll" +EXPORTS +ord_1000@8 @1000 +I_ScGetCurrentGroupStateW@12 +A_SHAFinal@8 +A_SHAInit@4 +A_SHAUpdate@12 +AbortSystemShutdownA@4 +AbortSystemShutdownW@4 +AccessCheck@32 +AccessCheckAndAuditAlarmA@44 +AccessCheckAndAuditAlarmW@44 +AccessCheckByType@44 +AccessCheckByTypeAndAuditAlarmA@64 +AccessCheckByTypeAndAuditAlarmW@64 +AccessCheckByTypeResultList@44 +AccessCheckByTypeResultListAndAuditAlarmA@64 +AccessCheckByTypeResultListAndAuditAlarmByHandleA@68 +AccessCheckByTypeResultListAndAuditAlarmByHandleW@68 +AccessCheckByTypeResultListAndAuditAlarmW@64 +AddAccessAllowedAce@16 +AddAccessAllowedAceEx@20 +AddAccessAllowedObjectAce@28 +AddAccessDeniedAce@16 +AddAccessDeniedAceEx@20 +AddAccessDeniedObjectAce@28 +AddAce@20 +AddAuditAccessAce@24 +AddAuditAccessAceEx@28 +AddAuditAccessObjectAce@36 +AddConditionalAce@32 +AddMandatoryAce@20 +AddUsersToEncryptedFile@8 +AddUsersToEncryptedFileEx@16 +AdjustTokenGroups@24 +AdjustTokenPrivileges@24 +AllocateAndInitializeSid@44 +AllocateLocallyUniqueId@4 +AreAllAccessesGranted@8 +AreAnyAccessesGranted@8 +AuditComputeEffectivePolicyBySid@16 +AuditComputeEffectivePolicyByToken@16 +AuditEnumerateCategories@8 +AuditEnumeratePerUserPolicy@4 +AuditEnumerateSubCategories@16 +AuditFree@4 +AuditLookupCategoryGuidFromCategoryId@8 +AuditLookupCategoryIdFromCategoryGuid@8 +AuditLookupCategoryNameA@8 +AuditLookupCategoryNameW@8 +AuditLookupSubCategoryNameA@8 +AuditLookupSubCategoryNameW@8 +AuditQueryGlobalSaclA@8 +AuditQueryGlobalSaclW@8 +AuditQueryPerUserPolicy@16 +AuditQuerySecurity@8 +AuditQuerySystemPolicy@12 +AuditSetGlobalSaclA@8 +AuditSetGlobalSaclW@8 +AuditSetPerUserPolicy@12 +AuditSetSecurity@8 +AuditSetSystemPolicy@8 +BackupEventLogA@8 +BackupEventLogW@8 +BuildExplicitAccessWithNameA@20 +BuildExplicitAccessWithNameW@20 +BuildImpersonateExplicitAccessWithNameA@24 +BuildImpersonateExplicitAccessWithNameW@24 +BuildImpersonateTrusteeA@8 +BuildImpersonateTrusteeW@8 +BuildSecurityDescriptorA@36 +BuildSecurityDescriptorW@36 +BuildTrusteeWithNameA@8 +BuildTrusteeWithNameW@8 +BuildTrusteeWithObjectsAndNameA@24 +BuildTrusteeWithObjectsAndNameW@24 +BuildTrusteeWithObjectsAndSidA@20 +BuildTrusteeWithObjectsAndSidW@20 +BuildTrusteeWithSidA@8 +BuildTrusteeWithSidW@8 +CancelOverlappedAccess@4 +ChangeServiceConfig2A@12 +ChangeServiceConfig2W@12 +ChangeServiceConfigA@44 +ChangeServiceConfigW@44 +CheckTokenMembership@12 +ClearEventLogA@8 +ClearEventLogW@8 +CloseCodeAuthzLevel@4 +CloseEncryptedFileRaw@4 +CloseEventLog@4 +CloseServiceHandle@4 +CloseThreadWaitChainSession@4 +CloseTrace@8 +CommandLineFromMsiDescriptor@12 +ComputeAccessTokenFromCodeAuthzLevel@20 +ControlService@12 +ControlServiceExA@16 +ControlServiceExW@16 +ControlTraceA@20 +ControlTraceW@20 +ConvertAccessToSecurityDescriptorA@20 +ConvertAccessToSecurityDescriptorW@20 +ConvertSDToStringSDRootDomainA@24 +ConvertSDToStringSDRootDomainW@24 +ConvertSecurityDescriptorToAccessA@28 +ConvertSecurityDescriptorToAccessNamedA@28 +ConvertSecurityDescriptorToAccessNamedW@28 +ConvertSecurityDescriptorToAccessW@28 +ConvertSecurityDescriptorToStringSecurityDescriptorA@20 +ConvertSecurityDescriptorToStringSecurityDescriptorW@20 +ConvertSidToStringSidA@8 +ConvertSidToStringSidW@8 +ConvertStringSDToSDDomainA@24 +ConvertStringSDToSDDomainW@24 +ConvertStringSDToSDRootDomainA@20 +ConvertStringSDToSDRootDomainW@20 +ConvertStringSecurityDescriptorToSecurityDescriptorA@16 +ConvertStringSecurityDescriptorToSecurityDescriptorW@16 +ConvertStringSidToSidA@8 +ConvertStringSidToSidW@8 +ConvertToAutoInheritPrivateObjectSecurity@24 +CopySid@12 +CreateCodeAuthzLevel@20 +CreatePrivateObjectSecurity@24 +CreatePrivateObjectSecurityEx@32 +CreatePrivateObjectSecurityWithMultipleInheritance@36 +CreateProcessAsUserA@44 +CreateProcessAsUserW@44 +CreateProcessWithLogonW@44 +CreateProcessWithTokenW@36 +CreateRestrictedToken@36 +CreateServiceA@52 +CreateServiceW@52 +CreateTraceInstanceId@8 +CreateWellKnownSid@16 +CredBackupCredentials@20 +CredDeleteA@12 +CredDeleteW@12 +CredEncryptAndMarshalBinaryBlob@12 +CredEnumerateA@16 +CredEnumerateW@16 +CredFindBestCredentialA@16 +CredFindBestCredentialW@16 +CredFree@4 +CredGetSessionTypes@8 +CredGetTargetInfoA@12 +CredGetTargetInfoW@12 +CredIsMarshaledCredentialA@4 +CredIsMarshaledCredentialW@4 +CredIsProtectedA@8 +CredIsProtectedW@8 +CredMarshalCredentialA@12 +CredMarshalCredentialW@12 +CredProfileLoaded@0 +CredProfileUnloaded@0 +CredProtectA@24 +CredProtectW@24 +CredReadA@16 +CredReadByTokenHandle@20 +CredReadDomainCredentialsA@16 +CredReadDomainCredentialsW@16 +CredReadW@16 +CredRenameA@16 +CredRenameW@16 +CredRestoreCredentials@16 +CredUnmarshalCredentialA@12 +CredUnmarshalCredentialW@12 +CredUnprotectA@20 +CredUnprotectW@20 +CredWriteA@8 +CredWriteDomainCredentialsA@12 +CredWriteDomainCredentialsW@12 +CredWriteW@8 +CredpConvertCredential@16 +CredpConvertOneCredentialSize@8 +CredpConvertTargetInfo@16 +CredpDecodeCredential@4 +CredpEncodeCredential@4 +CredpEncodeSecret@20 +CryptAcquireContextA@20 +CryptAcquireContextW@20 +CryptContextAddRef@12 +CryptCreateHash@20 +CryptDecrypt@24 +CryptDeriveKey@20 +CryptDestroyHash@4 +CryptDestroyKey@4 +CryptDuplicateHash@16 +CryptDuplicateKey@16 +CryptEncrypt@28 +CryptEnumProviderTypesA@24 +CryptEnumProviderTypesW@24 +CryptEnumProvidersA@24 +CryptEnumProvidersW@24 +CryptExportKey@24 +CryptGenKey@16 +CryptGenRandom@12 +CryptGetDefaultProviderA@20 +CryptGetDefaultProviderW@20 +CryptGetHashParam@20 +CryptGetKeyParam@20 +CryptGetProvParam@20 +CryptGetUserKey@12 +CryptHashData@16 +CryptHashSessionKey@12 +CryptImportKey@24 +CryptReleaseContext@8 +CryptSetHashParam@16 +CryptSetKeyParam@16 +CryptSetProvParam@16 +CryptSetProviderA@8 +CryptSetProviderExA@16 +CryptSetProviderExW@16 +CryptSetProviderW@8 +CryptSignHashA@24 +CryptSignHashW@24 +CryptVerifySignatureA@24 +CryptVerifySignatureW@24 +DecryptFileA@8 +DecryptFileW@8 +DeleteAce@8 +DeleteService@4 +DeregisterEventSource@4 +DestroyPrivateObjectSecurity@4 +DuplicateEncryptionInfoFile@20 +DuplicateToken@12 +DuplicateTokenEx@24 +ElfBackupEventLogFileA@8 +ElfBackupEventLogFileW@8 +ElfChangeNotify@8 +ElfClearEventLogFileA@8 +ElfClearEventLogFileW@8 +ElfCloseEventLog@4 +ElfDeregisterEventSource@4 +ElfFlushEventLog@4 +ElfNumberOfRecords@8 +ElfOldestRecord@8 +ElfOpenBackupEventLogA@12 +ElfOpenBackupEventLogW@12 +ElfOpenEventLogA@12 +ElfOpenEventLogW@12 +ElfReadEventLogA@28 +ElfReadEventLogW@28 +ElfRegisterEventSourceA@12 +ElfRegisterEventSourceW@12 +ElfReportEventA@48 +ElfReportEventAndSourceW@60 +ElfReportEventW@48 +EnableTrace@24 +EnableTraceEx2@44 +EnableTraceEx@48 +EncryptFileA@4 +EncryptFileW@4 +EncryptedFileKeyInfo@12 +EncryptionDisable@8 +EnumDependentServicesA@24 +EnumDependentServicesW@24 +EnumServiceGroupW@36 +EnumServicesStatusA@32 +EnumServicesStatusExA@40 +EnumServicesStatusExW@40 +EnumServicesStatusW@32 +EnumerateTraceGuids@12 +EnumerateTraceGuidsEx@24 +EqualDomainSid@12 +EqualPrefixSid@8 +EqualSid@8 +EventAccessControl@20 +EventAccessQuery@12 +EventAccessRemove@4 +EventActivityIdControl@8 +EventEnabled@12 +EventProviderEnabled@20 +EventRegister@16 +EventUnregister@8 +EventWrite@20 +EventWriteEndScenario@20 +EventWriteEx@40 +EventWriteStartScenario@20 +EventWriteString@24 +EventWriteTransfer@28 +FileEncryptionStatusA@8 +FileEncryptionStatusW@8 +FindFirstFreeAce@8 +FlushEfsCache@4 +FlushTraceA@16 +FlushTraceW@16 +FreeEncryptedFileKeyInfo@4 +FreeEncryptedFileMetadata@4 +FreeEncryptionCertificateHashList@4 +FreeInheritedFromArray@12 +FreeSid@4 +GetAccessPermissionsForObjectA@36 +GetAccessPermissionsForObjectW@36 +GetAce@12 +GetAclInformation@16 +GetAuditedPermissionsFromAclA@16 +GetAuditedPermissionsFromAclW@16 +GetCurrentHwProfileA@4 +GetCurrentHwProfileW@4 +GetEffectiveRightsFromAclA@12 +GetEffectiveRightsFromAclW@12 +GetEncryptedFileMetadata@12 +GetEventLogInformation@20 +GetExplicitEntriesFromAclA@12 +GetExplicitEntriesFromAclW@12 +GetFileSecurityA@20 +GetFileSecurityW@20 +GetInformationCodeAuthzLevelW@20 +GetInformationCodeAuthzPolicyW@24 +GetInheritanceSourceA@40 +GetInheritanceSourceW@40 +GetKernelObjectSecurity@20 +GetLengthSid@4 +GetLocalManagedApplicationData@12 +GetLocalManagedApplications@12 +GetManagedApplicationCategories@8 +GetManagedApplications@20 +GetMangledSiteSid@12 +GetMultipleTrusteeA@4 +GetMultipleTrusteeOperationA@4 +GetMultipleTrusteeOperationW@4 +GetMultipleTrusteeW@4 +GetNamedSecurityInfoA@32 +GetNamedSecurityInfoExA@36 +GetNamedSecurityInfoExW@36 +GetNamedSecurityInfoW@32 +GetNumberOfEventLogRecords@8 +GetOldestEventLogRecord@8 +GetOverlappedAccessResults@16 +GetPrivateObjectSecurity@20 +GetSecurityDescriptorControl@12 +GetSecurityDescriptorDacl@16 +GetSecurityDescriptorGroup@12 +GetSecurityDescriptorLength@4 +GetSecurityDescriptorOwner@12 +GetSecurityDescriptorRMControl@8 +GetSecurityDescriptorSacl@16 +GetSecurityInfo@32 +GetSecurityInfoExA@36 +GetSecurityInfoExW@36 +GetServiceDisplayNameA@16 +GetServiceDisplayNameW@16 +GetServiceKeyNameA@16 +GetServiceKeyNameW@16 +GetSidIdentifierAuthority@4 +GetSidLengthRequired@4 +GetSidSubAuthority@8 +GetSidSubAuthorityCount@4 +GetSiteDirectoryA@12 +GetSiteDirectoryW@12 +GetSiteNameFromSid@8 +GetSiteSidFromToken@4 +GetSiteSidFromUrl@4 +GetThreadWaitChain@28 +GetTokenInformation@20 +GetTraceEnableFlags@8 +GetTraceEnableLevel@8 +GetTraceLoggerHandle@4 +GetTrusteeFormA@4 +GetTrusteeFormW@4 +GetTrusteeNameA@4 +GetTrusteeNameW@4 +GetTrusteeTypeA@4 +GetTrusteeTypeW@4 +GetUserNameA@8 +GetUserNameW@8 +GetWindowsAccountDomainSid@12 +I_QueryTagInformation@12 +I_ScIsSecurityProcess@0 +I_ScPnPGetServiceName@12 +I_ScQueryServiceConfig@12 +I_ScSendPnPMessage@24 +I_ScSendTSMessage@16 +I_ScSetServiceBitsA@20 +I_ScSetServiceBitsW@20 +I_ScValidatePnPService@12 +IdentifyCodeAuthzLevelW@16 +ImpersonateAnonymousToken@4 +ImpersonateLoggedOnUser@4 +ImpersonateNamedPipeClient@4 +ImpersonateSelf@4 +InitializeAcl@12 +InitializeSecurityDescriptor@8 +InitializeSid@12 +InitiateShutdownA@20 +InitiateShutdownW@20 +InitiateSystemShutdownA@20 +InitiateSystemShutdownExA@24 +InitiateSystemShutdownExW@24 +InitiateSystemShutdownW@20 +InstallApplication@4 +IsProcessRestricted@0 +IsTextUnicode@12 +IsTokenRestricted@4 +IsTokenUntrusted@4 +IsValidAcl@4 +IsValidRelativeSecurityDescriptor@12 +IsValidSecurityDescriptor@4 +IsValidSid@4 +IsWellKnownSid@8 +LockServiceDatabase@4 +LogonUserA@24 +LogonUserExA@40 +LogonUserExExW@44 +LogonUserExW@40 +LogonUserW@24 +LookupAccountNameA@28 +LookupAccountNameW@28 +LookupAccountSidA@28 +LookupAccountSidW@28 +LookupPrivilegeDisplayNameA@20 +LookupPrivilegeDisplayNameW@20 +LookupPrivilegeNameA@16 +LookupPrivilegeNameW@16 +LookupPrivilegeValueA@12 +LookupPrivilegeValueW@12 +LookupSecurityDescriptorPartsA@28 +LookupSecurityDescriptorPartsW@28 +LsaAddAccountRights@16 +LsaAddPrivilegesToAccount@8 +LsaClearAuditLog@4 +LsaClose@4 +LsaCreateAccount@16 +LsaCreateSecret@16 +LsaCreateTrustedDomain@16 +LsaCreateTrustedDomainEx@20 +LsaDelete@4 +LsaDeleteTrustedDomain@8 +LsaEnumerateAccountRights@16 +LsaEnumerateAccounts@20 +LsaEnumerateAccountsWithUserRight@16 +LsaEnumeratePrivileges@20 +LsaEnumeratePrivilegesOfAccount@8 +LsaEnumerateTrustedDomains@20 +LsaEnumerateTrustedDomainsEx@20 +LsaFreeMemory@4 +LsaGetQuotasForAccount@8 +LsaGetRemoteUserName@12 +LsaGetSystemAccessAccount@8 +LsaGetUserName@8 +LsaICLookupNames@40 +LsaICLookupNamesWithCreds@48 +LsaICLookupSids@36 +LsaICLookupSidsWithCreds@48 +LsaLookupNames2@24 +LsaLookupNames@20 +LsaLookupPrivilegeDisplayName@16 +LsaLookupPrivilegeName@12 +LsaLookupPrivilegeValue@12 +LsaLookupSids@20 +LsaManageSidNameMapping@12 +LsaNtStatusToWinError@4 +LsaOpenAccount@16 +LsaOpenPolicy@16 +LsaOpenPolicySce@16 +LsaOpenSecret@16 +LsaOpenTrustedDomain@16 +LsaOpenTrustedDomainByName@16 +LsaQueryDomainInformationPolicy@12 +LsaQueryForestTrustInformation@12 +LsaQueryInfoTrustedDomain@12 +LsaQueryInformationPolicy@12 +LsaQuerySecret@20 +LsaQuerySecurityObject@12 +LsaQueryTrustedDomainInfo@16 +LsaQueryTrustedDomainInfoByName@16 +LsaRemoveAccountRights@20 +LsaRemovePrivilegesFromAccount@12 +LsaRetrievePrivateData@12 +LsaSetDomainInformationPolicy@12 +LsaSetForestTrustInformation@20 +LsaSetInformationPolicy@12 +LsaSetInformationTrustedDomain@12 +LsaSetQuotasForAccount@8 +LsaSetSecret@12 +LsaSetSecurityObject@12 +LsaSetSystemAccessAccount@8 +LsaSetTrustedDomainInfoByName@16 +LsaSetTrustedDomainInformation@16 +LsaStorePrivateData@12 +MD4Final@4 +MD4Init@4 +MD4Update@12 +MD5Final@4 +MD5Init@4 +MD5Update@12 +MSChapSrvChangePassword2@28 +MSChapSrvChangePassword@28 +MakeAbsoluteSD2@8 +MakeAbsoluteSD@44 +MakeSelfRelativeSD@12 +MapGenericMask@8 +NotifyBootConfigStatus@4 +NotifyChangeEventLog@8 +NotifyServiceStatusChange@12 +NotifyServiceStatusChangeA@12 +NotifyServiceStatusChangeW@12 +ObjectCloseAuditAlarmA@12 +ObjectCloseAuditAlarmW@12 +ObjectDeleteAuditAlarmA@12 +ObjectDeleteAuditAlarmW@12 +ObjectOpenAuditAlarmA@48 +ObjectOpenAuditAlarmW@48 +ObjectPrivilegeAuditAlarmA@24 +ObjectPrivilegeAuditAlarmW@24 +OpenBackupEventLogA@8 +OpenBackupEventLogW@8 +OpenEncryptedFileRawA@12 +OpenEncryptedFileRawW@12 +OpenEventLogA@8 +OpenEventLogW@8 +OpenProcessToken@12 +OpenSCManagerA@12 +OpenSCManagerW@12 +OpenServiceA@12 +OpenServiceW@12 +OpenThreadToken@16 +OpenThreadWaitChainSession@8 +OpenTraceA@4 +OpenTraceW@4 +PerfAddCounters@12 +PerfCloseQueryHandle@4 +PerfCreateInstance@16 +PerfDecrementULongCounterValue@16 +PerfDecrementULongLongCounterValue@20 +PerfDeleteCounters@12 +PerfDeleteInstance@8 +PerfEnumerateCounterSet@16 +PerfEnumerateCounterSetInstances@20 +PerfIncrementULongCounterValue@16 +PerfIncrementULongLongCounterValue@20 +PerfOpenQueryHandle@8 +PerfQueryCounterData@16 +PerfQueryCounterInfo@16 +PerfQueryCounterSetRegistrationInfo@28 +PerfQueryInstance@16 +PerfSetCounterRefValue@16 +PerfSetCounterSetInfo@12 +PerfSetULongCounterValue@16 +PerfSetULongLongCounterValue@20 +PerfStartProvider@12 +PerfStartProviderEx@12 +PerfStopProvider@4 +PrivilegeCheck@12 +PrivilegedServiceAuditAlarmA@20 +PrivilegedServiceAuditAlarmW@20 +ProcessIdleTasks@0 +ProcessIdleTasksW@16 +ProcessTrace@16 +QueryAllTracesA@12 +QueryAllTracesW@12 +QueryRecoveryAgentsOnEncryptedFile@8 +QuerySecurityAccessMask@8 +QueryServiceConfig2A@20 +QueryServiceConfig2W@20 +QueryServiceConfigA@16 +QueryServiceConfigW@16 +QueryServiceLockStatusA@16 +QueryServiceLockStatusW@16 +QueryServiceObjectSecurity@20 +QueryServiceStatus@8 +QueryServiceStatusEx@20 +QueryTraceA@16 +QueryTraceW@16 +QueryUsersOnEncryptedFile@8 +QueryWindows31FilesMigration@4 +ReadEncryptedFileRaw@12 +ReadEventLogA@28 +ReadEventLogW@28 +RegCloseKey@4 +RegConnectRegistryA@12 +RegConnectRegistryExA@16 +RegConnectRegistryExW@16 +RegConnectRegistryW@12 +RegCopyTreeA@12 +RegCopyTreeW@12 +RegCreateKeyA@12 +RegCreateKeyExA@36 +RegCreateKeyExW@36 +RegCreateKeyTransactedA@44 +RegCreateKeyTransactedW@44 +RegCreateKeyW@12 +RegDeleteKeyA@8 +RegDeleteKeyW@8 +RegDeleteKeyExA@16 +RegDeleteKeyExW@16 +RegDeleteKeyTransactedA@24 +RegDeleteKeyTransactedW@24 +RegDeleteKeyValueA@12 +RegDeleteKeyValueW@12 +RegDeleteKeyW@8 +RegDeleteTreeA@8 +RegDeleteTreeW@8 +RegDeleteValueA@8 +RegDeleteValueW@8 +RegDisablePredefinedCache@0 +RegDisablePredefinedCacheEx@0 +RegDisableReflectionKey@4 +RegEnableReflectionKey@4 +RegEnumKeyA@16 +RegEnumKeyExA@32 +RegEnumKeyExW@32 +RegEnumKeyW@16 +RegEnumValueA@32 +RegEnumValueW@32 +RegFlushKey@4 +RegGetKeySecurity@16 +RegGetValueA@28 +RegGetValueW@28 +RegLoadAppKeyA@20 +RegLoadAppKeyW@20 +RegLoadKeyA@12 +RegLoadKeyW@12 +RegLoadMUIStringA@28 +RegLoadMUIStringW@28 +RegNotifyChangeKeyValue@20 +RegOpenCurrentUser@8 +RegOpenKeyA@12 +RegOpenKeyExA@20 +RegOpenKeyExW@20 +RegOpenKeyTransactedA@28 +RegOpenKeyTransactedW@28 +RegOpenKeyW@12 +RegOpenUserClassesRoot@16 +RegOverridePredefKey@8 +RegQueryInfoKeyA@48 +RegQueryInfoKeyW@48 +RegQueryMultipleValuesA@20 +RegQueryMultipleValuesW@20 +RegQueryReflectionKey@8 +RegQueryValueA@16 +RegQueryValueExA@24 +RegQueryValueExW@24 +RegQueryValueW@16 +RegRenameKey@12 +RegReplaceKeyA@16 +RegReplaceKeyW@16 +RegRestoreKeyA@12 +RegRestoreKeyW@12 +RegSaveKeyA@12 +RegSaveKeyExA@16 +RegSaveKeyExW@16 +RegSaveKeyW@12 +RegSetKeySecurity@12 +RegSetKeyValueA@24 +RegSetKeyValueW@24 +RegSetValueA@20 +RegSetValueExA@24 +RegSetValueExW@24 +RegSetValueW@20 +RegUnLoadKeyA@8 +RegUnLoadKeyW@8 +RegisterEventSourceA@8 +RegisterEventSourceW@8 +RegisterIdleTask@16 +RegisterServiceCtrlHandlerA@8 +RegisterServiceCtrlHandlerExA@12 +RegisterServiceCtrlHandlerExW@12 +RegisterServiceCtrlHandlerW@8 +RegisterTraceGuidsA@32 +RegisterTraceGuidsW@32 +RegisterWaitChainCOMCallback@8 +RemoveTraceCallback@4 +RemoveUsersFromEncryptedFile@8 +ReportEventA@36 +ReportEventW@36 +RevertToSelf@0 +SaferCloseLevel@4 +SaferComputeTokenFromLevel@20 +SaferCreateLevel@20 +SaferGetLevelInformation@20 +SaferGetPolicyInformation@24 +SaferIdentifyLevel@16 +SaferRecordEventLogEntry@12 +SaferSetLevelInformation@16 +SaferSetPolicyInformation@20 +SaferiChangeRegistryScope@8 +SaferiCompareTokenLevels@12 +SaferiIsDllAllowed@12 +SaferiIsExecutableFileType@8 +SaferiPopulateDefaultsInRegistry@8 +SaferiRecordEventLogEntry@12 +SaferiSearchMatchingHashRules@24 +SetAclInformation@16 +SetEncryptedFileMetadata@24 +SetEntriesInAccessListA@24 +SetEntriesInAccessListW@24 +SetEntriesInAclA@16 +SetEntriesInAclW@16 +SetEntriesInAuditListA@24 +SetEntriesInAuditListW@24 +SetFileSecurityA@12 +SetFileSecurityW@12 +SetInformationCodeAuthzLevelW@16 +SetInformationCodeAuthzPolicyW@20 +SetKernelObjectSecurity@12 +SetNamedSecurityInfoA@28 +SetNamedSecurityInfoExA@36 +SetNamedSecurityInfoExW@36 +SetNamedSecurityInfoW@28 +SetPrivateObjectSecurity@20 +SetPrivateObjectSecurityEx@24 +SetSecurityAccessMask@8 +SetSecurityDescriptorControl@12 +SetSecurityDescriptorDacl@16 +SetSecurityDescriptorGroup@12 +SetSecurityDescriptorOwner@12 +SetSecurityDescriptorRMControl@8 +SetSecurityDescriptorSacl@16 +SetSecurityInfo@28 +SetSecurityInfoExA@36 +SetSecurityInfoExW@36 +SetServiceBits@16 +SetServiceObjectSecurity@12 +SetServiceStatus@8 +SetThreadToken@8 +SetTokenInformation@16 +SetTraceCallback@8 +SetUserFileEncryptionKey@4 +SetUserFileEncryptionKeyEx@16 +StartServiceA@12 +StartServiceCtrlDispatcherA@4 +StartServiceCtrlDispatcherW@4 +StartServiceW@12 +StartTraceA@12 +StartTraceW@12 +SynchronizeWindows31FilesAndWindowsNTRegistry@16 +StopTraceA@16 +StopTraceW@16 +SystemFunction001@12 +SystemFunction002@12 +SystemFunction003@8 +SystemFunction004@12 +SystemFunction005@12 +SystemFunction006@8 +SystemFunction007@8 +SystemFunction008@12 +SystemFunction009@12 +SystemFunction010@12 +SystemFunction011@12 +SystemFunction012@12 +SystemFunction013@12 +SystemFunction014@12 +SystemFunction015@12 +SystemFunction016@12 +SystemFunction017@12 +SystemFunction018@12 +SystemFunction019@12 +SystemFunction020@12 +SystemFunction021@12 +SystemFunction022@12 +SystemFunction023@12 +SystemFunction024@12 +SystemFunction025@12 +SystemFunction026@12 +SystemFunction027@12 +SystemFunction028@8 +SystemFunction029@8 +SystemFunction030@8 +SystemFunction031@8 +SystemFunction032@8 +SystemFunction033@8 +SystemFunction034@12 +SystemFunction035@4 +SystemFunction036@8 +SystemFunction040@12 +SystemFunction041@12 +TraceEvent@12 +TraceEventInstance@20 +TraceMessage +TraceMessageVa@24 +TraceSetInformation@20 +TreeResetNamedSecurityInfoA@44 +TreeResetNamedSecurityInfoW@44 +TreeSetNamedSecurityInfoA@44 +TreeSetNamedSecurityInfoW@44 +TrusteeAccessToObjectA@24 +TrusteeAccessToObjectW@24 +UninstallApplication@8 +UnlockServiceDatabase@4 +UnregisterIdleTask@12 +UnregisterTraceGuids@8 +UpdateTraceA@16 +UpdateTraceW@16 +UsePinForEncryptedFilesA@12 +UsePinForEncryptedFilesW@12 +WmiCloseBlock@4 +WmiDevInstToInstanceNameA@16 +WmiDevInstToInstanceNameW@16 +WmiEnumerateGuids@8 +WmiExecuteMethodA@28 +WmiExecuteMethodW@28 +WmiFileHandleToInstanceNameA@16 +WmiFileHandleToInstanceNameW@16 +WmiFreeBuffer@4 +WmiMofEnumerateResourcesA@12 +WmiMofEnumerateResourcesW@12 +WmiNotificationRegistrationA@20 +WmiNotificationRegistrationW@20 +WmiOpenBlock@12 +WmiQueryAllDataA@12 +WmiQueryAllDataMultipleA@16 +WmiQueryAllDataMultipleW@16 +WmiQueryAllDataW@12 +WmiQueryGuidInformation@8 +WmiQuerySingleInstanceA@16 +WmiQuerySingleInstanceMultipleA@20 +WmiQuerySingleInstanceMultipleW@20 +WmiQuerySingleInstanceW@16 +WmiReceiveNotificationsA@16 +WmiReceiveNotificationsW@16 +WmiSetSingleInstanceA@20 +WmiSetSingleInstanceW@20 +WmiSetSingleItemA@24 +WmiSetSingleItemW@24 +WriteEncryptedFileRaw@12 diff --git a/lib/libc/mingw/lib32/gdi32.def b/lib/libc/mingw/lib32/gdi32.def new file mode 100644 index 0000000000..a2677fb51f --- /dev/null +++ b/lib/libc/mingw/lib32/gdi32.def @@ -0,0 +1,376 @@ +LIBRARY GDI32.dll +EXPORTS +AbortDoc@4 +AbortPath@4 +AddFontMemResourceEx@16 +AddFontResourceA@4 +AddFontResourceW@4 +AddFontResourceExA@12 +AddFontResourceExW@12 +AngleArc@24 +AnimatePalette@16 +Arc@36 +ArcTo@36 +BeginPath@4 +BitBlt@36 +CancelDC@4 +CheckColorsInGamut@16 +ChoosePixelFormat@8 +Chord@36 +CloseEnhMetaFile@4 +CloseFigure@4 +CloseMetaFile@4 +ColorCorrectPalette@16 +ColorMatchToTarget@12 +CombineRgn@16 +CombineTransform@12 +CopyEnhMetaFileA@8 +CopyEnhMetaFileW@8 +CopyMetaFileA@8 +CopyMetaFileW@8 +CreateBitmap@20 +CreateBitmapIndirect@4 +CreateBrushIndirect@4 +CreateColorSpaceA@4 +CreateColorSpaceW@4 +CreateCompatibleBitmap@12 +CreateCompatibleDC@4 +CreateDCA@16 +CreateDCW@16 +CreateDIBPatternBrush@8 +CreateDIBPatternBrushPt@8 +CreateDIBSection@24 +CreateDIBitmap@24 +CreateDiscardableBitmap@12 +CreateEllipticRgn@16 +CreateEllipticRgnIndirect@4 +CreateEnhMetaFileA@16 +CreateEnhMetaFileW@16 +CreateFontA@56 +CreateFontIndirectA@4 +CreateFontIndirectExA@4 +CreateFontIndirectExW@4 +CreateFontIndirectW@4 +CreateFontW@56 +CreateHalftonePalette@4 +CreateHatchBrush@8 +CreateICA@16 +CreateICW@16 +CreateMetaFileA@4 +CreateMetaFileW@4 +CreatePalette@4 +CreatePatternBrush@4 +CreatePen@12 +CreatePenIndirect@4 +CreatePolyPolygonRgn@16 +CreatePolygonRgn@12 +CreateRectRgn@16 +CreateRectRgnIndirect@4 +CreateRoundRectRgn@24 +CreateScalableFontResourceA@16 +CreateScalableFontResourceW@16 +CreateSolidBrush@4 +DPtoLP@12 +DeleteColorSpace@4 +DeleteDC@4 +DeleteEnhMetaFile@4 +DeleteMetaFile@4 +DeleteObject@4 +DescribePixelFormat@16 +DeviceCapabilitiesEx@24 +DeviceCapabilitiesExA@24 +DeviceCapabilitiesExW@24 +DrawEscape@16 +Ellipse@20 +EnableEUDC@4 +EndDoc@4 +EndPage@4 +EndPath@4 +EnumEnhMetaFile@20 +EnumFontFamiliesA@16 +EnumFontFamiliesExA@20 +EnumFontFamiliesExW@20 +EnumFontFamiliesW@16 +EnumFontsA@16 +EnumFontsW@16 +EnumICMProfilesA@12 +EnumICMProfilesW@12 +EnumMetaFile@16 +EnumObjects@16 +EqualRgn@8 +Escape@20 +ExcludeClipRect@20 +ExtCreatePen@20 +ExtCreateRegion@12 +ExtEscape@24 +ExtFloodFill@20 +ExtSelectClipRgn@12 +ExtTextOutA@32 +ExtTextOutW@32 +FillPath@4 +FillRgn@12 +FixBrushOrgEx@16 +FlattenPath@4 +FloodFill@16 +FontIsLinked@4 +FrameRgn@20 +GdiAlphaBlend@44 +GdiComment@12 +GdiConvertToDevmodeW@4 +GdiEntry13@0 ; alias for DdQueryDisplaySettingsUniqueness +GdiFlush@0 +GdiGetBatchLimit@0 +GdiGetCharDimensions@12 +GdiGetCodePage@4 +GdiGetSpoolMessage@16 +GdiGradientFill@24 +GdiInitSpool@0 +GdiInitializeLanguagePack@4 +GdiIsMetaFileDC@4 +GdiIsMetaPrintDC@4 +GdiIsPlayMetafileDC@4 +GdiPlayDCScript@24 +GdiPlayJournal@20 +GdiPlayScript@28 +GdiRealizationInfo@8 +GdiSetBatchLimit@4 +GdiTransparentBlt@44 +GetArcDirection@4 +GetAspectRatioFilterEx@8 +GetBitmapBits@12 +GetBitmapDimensionEx@8 +GetBkColor@4 +GetBkMode@4 +GetBoundsRect@12 +GetBrushOrgEx@8 +GetCharABCWidthsA@16 +GetCharABCWidthsFloatA@16 +GetCharABCWidthsFloatW@16 +GetCharABCWidthsI@20 +GetCharABCWidthsW@16 +GetCharWidth32A@16 +GetCharWidth32W@16 +GetCharWidthA@16 +GetCharWidthFloatA@16 +GetCharWidthFloatW@16 +GetCharWidthI@20 +GetCharWidthW@16 +GetCharacterPlacementA@24 +GetCharacterPlacementW@24 +GetClipBox@8 +GetClipRgn@8 +GetColorAdjustment@8 +GetColorSpace@4 +GetCurrentObject@8 +GetCurrentPositionEx@8 +GetDCBrushColor@4 +GetDCOrgEx@8 +GetDCPenColor@4 +GetDIBColorTable@16 +GetDIBits@28 +GetDeviceCaps@8 +GetDeviceGammaRamp@8 +GetEnhMetaFileA@4 +GetEnhMetaFileBits@12 +GetEnhMetaFileDescriptionA@12 +GetEnhMetaFileDescriptionW@12 +GetEnhMetaFileHeader@12 +GetEnhMetaFilePaletteEntries@12 +GetEnhMetaFilePixelFormat@12 +GetEnhMetaFileW@4 +GetFontData@20 +GetFontLanguageInfo@4 +GetFontResourceInfo@16 +GetFontResourceInfoW@16 +GetFontUnicodeRanges@8 +GetGlyphIndicesA@20 +GetGlyphIndicesW@20 +GetGlyphOutline@28 +GetGlyphOutlineA@28 +GetGlyphOutlineW@28 +GetGlyphOutlineWow@28 +GetGraphicsMode@4 +GetICMProfileA@12 +GetICMProfileW@12 +GetKerningPairs@12 +GetKerningPairsA@12 +GetKerningPairsW@12 +GetLayout@4 +GetLogColorSpaceA@12 +GetLogColorSpaceW@12 +GetMapMode@4 +GetMetaFileA@4 +GetMetaFileBitsEx@12 +GetMetaFileW@4 +GetMetaRgn@8 +GetMiterLimit@8 +GetNearestColor@8 +GetNearestPaletteIndex@8 +GetObjectA@12 +GetObjectType@4 +GetObjectW@12 +GetOutlineTextMetricsA@12 +GetOutlineTextMetricsW@12 +GetPaletteEntries@16 +GetPath@16 +GetPixel@12 +GetPixelFormat@4 +GetPolyFillMode@4 +GetROP2@4 +GetRandomRgn@12 +GetRasterizerCaps@8 +GetRegionData@12 +GetRelAbs@8 +GetRgnBox@8 +GetStockObject@4 +GetStretchBltMode@4 +GetSystemPaletteEntries@16 +GetSystemPaletteUse@4 +GetTextAlign@4 +GetTextCharacterExtra@4 +GetTextCharset@4 +GetTextCharsetInfo@12 +GetTextColor@4 +GetTextExtentExPointA@28 +GetTextExtentExPointW@28 +GetTextExtentExPointI@28 +GetTextExtentPoint32A@16 +GetTextExtentPoint32W@16 +GetTextExtentPointA@16 +GetTextExtentPointI@16 +GetTextExtentPointW@16 +GetTextFaceA@12 +GetTextFaceW@12 +GetTextMetricsA@8 +GetTextMetricsW@8 +GetTransform@12 +GetViewportExtEx@8 +GetViewportOrgEx@8 +GetWinMetaFileBits@20 +GetWindowExtEx@8 +GetWindowOrgEx@8 +GetWorldTransform@8 +IntersectClipRect@20 +InvertRgn@8 +LPtoDP@12 +LineDDA@24 +LineTo@12 +MaskBlt@48 +ModifyWorldTransform@12 +MoveToEx@16 +NamedEscape@28 +OffsetClipRgn@12 +OffsetRgn@12 +OffsetViewportOrgEx@16 +OffsetWindowOrgEx@16 +PaintRgn@8 +PatBlt@24 +PathToRegion@4 +Pie@36 +PlayEnhMetaFile@12 +PlayEnhMetaFileRecord@16 +PlayMetaFile@8 +PlayMetaFileRecord@16 +PlgBlt@40 +PolyBezier@12 +PolyBezierTo@12 +PolyDraw@16 +PolyPolygon@16 +PolyPolyline@16 +PolyTextOutA@12 +PolyTextOutW@12 +Polygon@12 +Polyline@12 +PolylineTo@12 +PtInRegion@12 +PtVisible@12 +RealizePalette@4 +RectInRegion@8 +RectVisible@8 +Rectangle@20 +RemoveFontMemResourceEx@4 +RemoveFontResourceA@4 +RemoveFontResourceW@4 +RemoveFontResourceExA@12 +RemoveFontResourceExW@12 +ResetDCA@8 +ResetDCW@8 +ResizePalette@8 +RestoreDC@8 +RoundRect@28 +SaveDC@4 +ScaleViewportExtEx@24 +ScaleWindowExtEx@24 +SelectBrushLocal@8 +SelectClipPath@8 +SelectClipRgn@8 +SelectFontLocal@8 +SelectObject@8 +SelectPalette@12 +SetAbortProc@8 +SetArcDirection@8 +SetBitmapBits@12 +SetBitmapDimensionEx@16 +SetBkColor@8 +SetBkMode@8 +SetBoundsRect@12 +SetBrushOrgEx@16 +SetColorAdjustment@8 +SetColorSpace@8 +SetDCBrushColor@8 +SetDCPenColor@8 +SetDIBColorTable@16 +SetDIBits@28 +SetDIBitsToDevice@48 +SetDeviceGammaRamp@8 +SetEnhMetaFileBits@8 +SetFontEnumeration@4 +SetGraphicsMode@8 +SetICMMode@8 +SetICMProfileA@8 +SetICMProfileW@8 +SetLayout@8 +SetMagicColors@12 +SetMapMode@8 +SetMapperFlags@8 +SetMetaFileBitsEx@8 +SetMetaRgn@4 +SetMiterLimit@12 +SetPaletteEntries@16 +SetPixel@16 +SetPixelFormat@12 +SetPixelV@16 +SetPolyFillMode@8 +SetROP2@8 +SetRectRgn@20 +SetRelAbs@8 +SetStretchBltMode@8 +SetSystemPaletteUse@8 +SetTextAlign@8 +SetTextCharacterExtra@8 +SetTextColor@8 +SetTextJustification@12 +SetViewportExtEx@16 +SetViewportOrgEx@16 +SetVirtualResolution@20 +SetWinMetaFileBits@16 +SetWindowExtEx@16 +SetWindowOrgEx@16 +SetWorldTransform@8 +StartDocA@8 +StartDocW@8 +StartPage@4 +StretchBlt@44 +StretchDIBits@52 +StrokeAndFillPath@4 +StrokePath@4 +SwapBuffers@4 +TextOutA@20 +TextOutW@20 +TranslateCharsetInfo@12 +UnrealizeObject@4 +UpdateColors@4 +UpdateICMRegKeyA@16 +UpdateICMRegKeyW@16 +WidenPath@4 +gdiPlaySpoolStream@24 diff --git a/lib/libc/mingw/lib32/imm32.def b/lib/libc/mingw/lib32/imm32.def new file mode 100644 index 0000000000..ad2ceb442e --- /dev/null +++ b/lib/libc/mingw/lib32/imm32.def @@ -0,0 +1,136 @@ +LIBRARY IMM32.DLL +EXPORTS +CtfImmAppCompatEnableIMEonProtectedCode +CtfImmCoUninitialize +CtfImmDispatchDefImeMessage@16 +CtfImmEnterCoInitCountSkipMode +CtfImmGenerateMessage@8 +CtfImmGetCompatibleKeyboardLayout@4 +CtfImmGetGuidAtom@12 +CtfImmGetIMEFileName@8 +CtfImmGetTMAEFlags +CtfImmHideToolbarWnd +CtfImmIsCiceroEnabled +CtfImmIsCiceroStartedInThread +CtfImmIsGuidMapEnable@4 +CtfImmIsTextFrameServiceDisabled +CtfImmLastEnabledWndDestroy@4 +CtfImmLeaveCoInitCountSkipMode +CtfImmNotify@12 +CtfImmRestoreToolbarWnd@4 +CtfImmSetAppCompatFlags@4 +CtfImmSetCiceroStartInThread@4 +CtfImmSetDefaultRemoteKeyboardLayout@8 +CtfImmTIMActivate@8 +GetKeyboardLayoutCP@4 +ImmActivateLayout@4 +ImmAssociateContext@8 +ImmAssociateContextEx@12 +ImmCallImeConsoleIME@20 +ImmConfigureIMEA@16 +ImmConfigureIMEW@16 +ImmCreateContext@0 +ImmCreateIMCC@4 +ImmCreateSoftKeyboard@16 +ImmDestroyContext@4 +ImmDestroyIMCC@4 +ImmDestroySoftKeyboard@4 +ImmDisableIME@4 +ImmDisableIme@4 +ImmDisableTextFrameService@4 +ImmEnumInputContext@12 +ImmEnumRegisterWordA@24 +ImmEnumRegisterWordW@24 +ImmEscapeA@16 +ImmEscapeW@16 +ImmFreeLayout@4 +ImmGenerateMessage@4 +ImmGetAppCompatFlags@4 +ImmGetCandidateListA@16 +ImmGetCandidateListCountA@8 +ImmGetCandidateListCountW@8 +ImmGetCandidateListW@16 +ImmGetCandidateWindow@12 +ImmGetCompositionFontA@8 +ImmGetCompositionFontW@8 +ImmGetCompositionStringA@16 +ImmGetCompositionStringW@16 +ImmGetCompositionWindow@8 +ImmGetContext@4 +ImmGetConversionListA@24 +ImmGetConversionListW@24 +ImmGetConversionStatus@12 +ImmGetDefaultIMEWnd@4 +ImmGetDescriptionA@12 +ImmGetDescriptionW@12 +ImmGetGuideLineA@16 +ImmGetGuideLineW@16 +ImmGetHotKey@16 +ImmGetIMCCLockCount@4 +ImmGetIMCCSize@4 +ImmGetIMCLockCount@4 +ImmGetIMEFileNameA@12 +ImmGetIMEFileNameW@12 +ImmGetImeInfoEx@12 +ImmGetImeMenuItemsA@24 +ImmGetImeMenuItemsW@24 +ImmGetOpenStatus@4 +ImmGetProperty@8 +ImmGetRegisterWordStyleA@12 +ImmGetRegisterWordStyleW@12 +ImmGetStatusWindowPos@8 +ImmGetVirtualKey@4 +ImmIMPGetIMEA@8 +ImmIMPGetIMEW@8 +ImmIMPQueryIMEA@4 +ImmIMPQueryIMEW@4 +ImmIMPSetIMEA@8 +ImmIMPSetIMEW@8 +ImmInstallIMEA@8 +ImmInstallIMEW@8 +ImmIsIME@4 +ImmIsUIMessageA@16 +ImmIsUIMessageW@16 +ImmLoadIME@4 +ImmLoadLayout@8 +ImmLockClientImc@4 +ImmLockIMC@4 +ImmLockIMCC@4 +ImmLockImeDpi@4 +ImmNotifyIME@16 +ImmProcessKey@20 +ImmPutImeMenuItemsIntoMappedFile@4 +ImmReSizeIMCC@8 +ImmRegisterClient@8 +ImmRegisterWordA@16 +ImmRegisterWordW@16 +ImmReleaseContext@8 +ImmRequestMessageA@12 +ImmRequestMessageW@12 +ImmSendIMEMessageExA@8 +ImmSendIMEMessageExW@8 +ImmSetActiveContext@12 +ImmSetActiveContextConsoleIME@8 +ImmSetCandidateWindow@8 +ImmSetCompositionFontA@8 +ImmSetCompositionFontW@8 +ImmSetCompositionStringA@24 +ImmSetCompositionStringW@24 +ImmSetCompositionWindow@8 +ImmSetConversionStatus@12 +ImmSetHotKey@16 +ImmSetOpenStatus@8 +ImmSetStatusWindowPos@8 +ImmShowSoftKeyboard@8 +ImmSimulateHotKey@8 +ImmSystemHandler@12 +ImmTranslateMessage@16 +ImmUnlockClientImc@4 +ImmUnlockIMC@4 +ImmUnlockIMCC@4 +ImmUnlockImeDpi@4 +ImmUnregisterWordA@16 +ImmUnregisterWordW@16 +ImmWINNLSEnableIME@8 +ImmWINNLSGetEnableStatus@4 +ImmWINNLSGetIMEHotkey@4 diff --git a/lib/libc/mingw/lib32/kernel32.def b/lib/libc/mingw/lib32/kernel32.def new file mode 100644 index 0000000000..464a199963 --- /dev/null +++ b/lib/libc/mingw/lib32/kernel32.def @@ -0,0 +1,1660 @@ +; +; Definition file of KERNEL32.dll +; Automatic generated by gendef +; written by Kai Tietz 2008 +; +LIBRARY "KERNEL32.dll" +EXPORTS +BaseThreadInitThunk@4 +InterlockedPushListSList@8 +AcquireSRWLockExclusive@4 +AcquireSRWLockShared@4 +ActivateActCtx@8 +ActivateActCtxWorker@8 +AddAtomA@4 +AddAtomW@4 +AddConsoleAliasA@12 +AddConsoleAliasW@12 +AddDllDirectory@4 +AddIntegrityLabelToBoundaryDescriptor@8 +AddLocalAlternateComputerNameA@8 +AddLocalAlternateComputerNameW@8 +AddRefActCtx@4 +AddRefActCtxWorker@4 +AddResourceAttributeAce@28 +AddSIDToBoundaryDescriptor@8 +AddScopedPolicyIDAce@20 +AddSecureMemoryCacheCallback@4 +AddVectoredContinueHandler@8 +AddVectoredExceptionHandler@8 +AdjustCalendarDate@12 +AllocConsole@0 +AllocateUserPhysicalPages@12 +AllocateUserPhysicalPagesNuma@16 +AppPolicyGetClrCompat@8 +AppPolicyGetCreateFileAccess@8 +AAppPolicyGetLifecycleManagement@8 +AppPolicyGetMediaFoundationCodecLoading@8 +AppPolicyGetProcessTerminationMethod@8 +AppPolicyGetShowDeveloperDiagnostic@8 +AppPolicyGetThreadInitializationType@8 +AppPolicyGetWindowingModel@8 +AppXGetOSMaxVersionTested@8 +ApplicationRecoveryFinished@4 +ApplicationRecoveryInProgress@4 +AreFileApisANSI@0 +AssignProcessToJobObject@8 +AttachConsole@4 +BackupRead@28 +BackupSeek@24 +BackupWrite@28 +BaseAttachCompleteThunk@0 +BaseCheckAppcompatCache@16 +BaseCheckAppcompatCacheEx@24 +BaseCheckAppcompatCacheExWorker@36 +BaseCheckAppcompatCacheWorker@16 +BaseCheckElevation@48 +BaseCheckRunApp@52 +BaseCleanupAppcompatCacheSupport@4 +BaseDllReadWriteIniFile@32 +BaseDumpAppcompatCache@0 +BaseDumpAppcompatCacheWorker@0 +BaseElevationPostProcessing@12 +BaseFlushAppcompatCache@0 +BaseFlushAppcompatCacheWorker@0 +BaseFormatObjectAttributes@16 +BaseFormatTimeOut@8 +BaseFreeAppCompatDataForProcessWorker@4 +BaseGenerateAppCompatData@24 +BaseGetNamedObjectDirectory@4 +BaseInitAppcompatCacheSupport@0 +BaseInitAppcompatCacheSupportWorker@0 +BaseIsAppcompatInfrastructureDisabled@0 +BaseIsAppcompatInfrastructureDisabledWorker@0 +BaseIsDosApplication@8 +BaseQueryModuleData@28 +BaseReadAppCompatDataForProcessWorker@12 +BaseSetLastNTError@4 +BaseUpdateAppcompatCache@12 +BaseUpdateAppcompatCacheWorker@12 +BaseUpdateVDMEntry@16 +BaseVerifyUnicodeString@4 +BaseWriteErrorElevationRequiredEvent@0 +Basep8BitStringToDynamicUnicodeString@8 +BasepAllocateActivationContextActivationBlock@16 +BasepAnsiStringToDynamicUnicodeString@8 +BasepAppContainerEnvironmentExtension@12 +BasepAppXExtension@24 +BasepCheckAppCompat@16 +BasepCheckBadapp@56 +BasepCheckWebBladeHashes@4 +BasepCheckWinSaferRestrictions@28 +BasepConstructSxsCreateProcessMessage@80 +BasepCopyEncryption@12 +BasepFreeActivationContextActivationBlock@4 +BasepFreeAppCompatData@12 +BasepGetAppCompatData@60 +BasepGetComputerNameFromNtPath@16 +BasepGetExeArchType@12 +BasepInitAppCompatData@12 +BasepIsProcessAllowed@4 +BasepMapModuleHandle@8 +BasepNotifyLoadStringResource@16 +BasepPostSuccessAppXExtension@8 +BasepProcessInvalidImage@84 +BasepQueryAppCompat@72 +BasepQueryModuleChpeSettings@40 +BasepReleaseAppXContext@4 +BasepReleaseSxsCreateProcessUtilityStruct@4 +BasepReportFault@8 +BasepSetFileEncryptionCompression@32 +Beep@8 +BeginUpdateResourceA@8 +BeginUpdateResourceW@8 +BindIoCompletionCallback@12 +BuildCommDCBA@8 +BuildCommDCBAndTimeoutsA@12 +BuildCommDCBAndTimeoutsW@12 +BuildCommDCBW@8 +CallNamedPipeA@28 +CallNamedPipeW@28 +CallbackMayRunLong@4 +CancelDeviceWakeupRequest@4 +CancelIo@4 +CancelIoEx@8 +CancelSynchronousIo@4 +CancelThreadpoolIo@4 +CancelTimerQueueTimer@8 +CancelWaitableTimer@4 +CeipIsOptedIn@0 +ChangeTimerQueueTimer@16 +CheckAllowDecryptedRemoteDestinationPolicy@0 +CheckElevation@20 +CheckElevationEnabled@4 +CheckForReadOnlyResource@8 +CheckForReadOnlyResourceFilter@4 +CheckNameLegalDOS8Dot3A@20 +CheckNameLegalDOS8Dot3W@20 +CheckRemoteDebuggerPresent@8 +CheckTokenCapability@12 +CheckTokenMembershipEx@16 +ClearCommBreak@4 +ClearCommError@12 +CloseConsoleHandle@4 +CloseHandle@4 +ClosePackageInfo@4 +ClosePrivateNamespace@8 +CloseProfileUserMapping@0 +ClosePseudoConsole@4 +CloseState@4 +CloseThreadpool@4 +CloseThreadpoolCleanupGroup@4 +CloseThreadpoolCleanupGroupMembers@12 +CloseThreadpoolIo@4 +CloseThreadpoolTimer@4 +CloseThreadpoolWait@4 +CloseThreadpoolWork@4 +CmdBatNotification@4 +CommConfigDialogA@12 +CommConfigDialogW@12 +CompareCalendarDates@12 +CompareFileTime@8 +CompareStringA@24 +CompareStringEx@36 +CompareStringOrdinal@20 +CompareStringW@24 +ConnectNamedPipe@8 +ConsoleIMERoutine@4 +ConsoleMenuControl@12 +ContinueDebugEvent@12 +ConvertCalDateTimeToSystemTime@8 +ConvertDefaultLocale@4 +ConvertFiberToThread@0 +ConvertNLSDayOfWeekToWin32DayOfWeek@4 +ConvertSystemTimeToCalDateTime@12 +ConvertThreadToFiber@4 +ConvertThreadToFiberEx@8 +ConvertToGlobalHandle@4 +CopyContext@12 +CopyFile2@12 +CopyFileA@12 +CopyFileExA@24 +CopyFileExW@24 +CopyFileTransactedA@28 +CopyFileTransactedW@28 +CopyFileW@12 +CopyLZFile@8 +CreateActCtxA@4 +CreateActCtxW@4 +CreateActCtxWWorker@4 +CreateBoundaryDescriptorA@8 +CreateBoundaryDescriptorW@8 +CreateConsoleScreenBuffer@20 +CreateDirectoryA@8 +CreateDirectoryExA@12 +CreateDirectoryExW@12 +CreateDirectoryTransactedA@16 +CreateDirectoryTransactedW@16 +CreateDirectoryW@8 +CreateEnclave@32 +CreateEventA@16 +CreateEventExA@16 +CreateEventExW@16 +CreateEventW@16 +CreateFiber@12 +CreateFiberEx@20 +CreateFile2@20 +CreateFileA@28 +CreateFileMappingA@24 +CreateFileMappingFromApp@24 +CreateFileMappingNumaA@28 +CreateFileMappingNumaW@28 +CreateFileMappingW@24 +CreateFileTransactedA@40 +CreateFileTransactedW@40 +CreateFileW@28 +CreateHardLinkA@12 +CreateHardLinkTransactedA@16 +CreateHardLinkTransactedW@16 +CreateHardLinkW@12 +CreateIoCompletionPort@16 +CreateJobObjectA@8 +CreateJobObjectW@8 +CreateJobSet@12 +CreateMailslotA@16 +CreateMailslotW@16 +CreateMemoryResourceNotification@4 +CreateMutexA@12 +CreateMutexExA@16 +CreateMutexExW@16 +CreateMutexW@12 +CreateNamedPipeA@32 +CreateNamedPipeW@32 +CreatePipe@16 +CreatePrivateNamespaceA@12 +CreatePrivateNamespaceW@12 +CreateProcessA@40 +CreateProcessAsUserA@44 +CreateProcessAsUserW@44 +CreateProcessInternalA@48 +CreateProcessInternalW@48 +CreateProcessW@40 +CreatePseudoConsole@20 +CreateRemoteThread@28 +CreateRemoteThreadEx@32 +CreateSemaphoreA@16 +CreateSemaphoreExA@24 +CreateSemaphoreExW@24 +CreateSemaphoreW@16 +CreateSocketHandle@0 +CreateSymbolicLinkA@12 +CreateSymbolicLinkTransactedA@16 +CreateSymbolicLinkTransactedW@16 +CreateSymbolicLinkW@12 +CreateTapePartition@16 +CreateThread@24 +CreateThreadpool@4 +CreateThreadpoolCleanupGroup@0 +CreateThreadpoolIo@16 +CreateThreadpoolTimer@12 +CreateThreadpoolWait@12 +CreateThreadpoolWork@12 +CreateTimerQueue@0 +CreateTimerQueueTimer@28 +CreateToolhelp32Snapshot@8 +CreateVirtualBuffer@12 +CreateWaitableTimerA@12 +CreateWaitableTimerExA@16 +CreateWaitableTimerExW@16 +CreateWaitableTimerW@12 +CtrlRoutine@4 +DeactivateActCtx@8 +DeactivateActCtxWorker@8 +DebugActiveProcess@4 +DebugActiveProcessStop@4 +DebugBreak@0 +DebugBreakProcess@4 +DebugSetProcessKillOnExit@4 +DecodePointer@4 +DecodeSystemPointer@4 +DefineDosDeviceA@12 +DefineDosDeviceW@12 +DelayLoadFailureHook@8 +DeleteAtom@4 +DeleteBoundaryDescriptor@4 +DeleteCriticalSection@4 +DeleteFiber@4 +DeleteFileA@4 +DeleteFileTransactedA@8 +DeleteFileTransactedW@8 +DeleteFileW@4 +DeleteProcThreadAttributeList@4 +DeleteSynchronizationBarrier@4 +DeleteTimerQueue@4 +DeleteTimerQueueEx@8 +DeleteTimerQueueTimer@12 +DeleteVolumeMountPointA@4 +DeleteVolumeMountPointW@4 +DeviceIoControl@32 +DisableThreadLibraryCalls@4 +DisableThreadProfiling@4 +DisassociateCurrentThreadFromCallback@4 +DiscardVirtualMemory@8 +DisconnectNamedPipe@4 +DnsHostnameToComputerNameA@12 +DnsHostnameToComputerNameExW@12 +DnsHostnameToComputerNameW@12 +DosDateTimeToFileTime@12 +DosPathToSessionPathA@12 +DosPathToSessionPathW@12 +DuplicateConsoleHandle@16 +DuplicateEncryptionInfoFileExt@20 +DuplicateHandle@28 +EnableThreadProfiling@20 +EncodePointer@4 +EncodeSystemPointer@4 +EndUpdateResourceA@8 +EndUpdateResourceW@8 +EnterCriticalSection@4 +EnterSynchronizationBarrier@8 +EnumCalendarInfoA@16 +EnumCalendarInfoExA@16 +EnumCalendarInfoExEx@24 +EnumCalendarInfoExW@16 +EnumCalendarInfoW@16 +EnumDateFormatsA@12 +EnumDateFormatsExA@12 +EnumDateFormatsExEx@16 +EnumDateFormatsExW@12 +EnumDateFormatsW@12 +EnumLanguageGroupLocalesA@16 +EnumLanguageGroupLocalesW@16 +EnumResourceLanguagesA@20 +EnumResourceLanguagesExA@28 +EnumResourceLanguagesExW@28 +EnumResourceLanguagesW@20 +EnumResourceNamesA@16 +EnumResourceNamesExA@24 +EnumResourceNamesExW@24 +EnumResourceNamesW@16 +EnumResourceTypesA@12 +EnumResourceTypesExA@20 +EnumResourceTypesExW@20 +EnumResourceTypesW@12 +EnumSystemCodePagesA@8 +EnumSystemCodePagesW@8 +EnumSystemFirmwareTables@12 +EnumSystemGeoID@12 +EnumSystemGeoNames@12 +EnumSystemLanguageGroupsA@12 +EnumSystemLanguageGroupsW@12 +EnumSystemLocalesA@8 +EnumSystemLocalesEx@16 +EnumSystemLocalesW@8 +EnumTimeFormatsA@12 +EnumTimeFormatsEx@16 +EnumTimeFormatsW@12 +EnumUILanguagesA@12 +EnumUILanguagesW@12 +EnumerateLocalComputerNamesA@16 +EnumerateLocalComputerNamesW@16 +EraseTape@12 +EscapeCommFunction@8 +ExitProcess@4 +ExitThread@4 +ExitVDM@8 +ExpandEnvironmentStringsA@12 +ExpandEnvironmentStringsW@12 +ExpungeConsoleCommandHistoryA@4 +ExpungeConsoleCommandHistoryW@4 +ExtendVirtualBuffer@8 +FatalAppExitA@8 +FatalAppExitW@8 +FatalExit@4 +FileTimeToDosDateTime@12 +FileTimeToLocalFileTime@8 +FileTimeToSystemTime@8 +FillConsoleOutputAttribute@20 +FillConsoleOutputCharacterA@20 +FillConsoleOutputCharacterW@20 +FindActCtxSectionGuid@20 +FindActCtxSectionGuidWorker@20 +FindActCtxSectionStringA@20 +FindActCtxSectionStringW@20 +FindActCtxSectionStringWWorker@20 +FindAtomA@4 +FindAtomW@4 +FindClose@4 +FindCloseChangeNotification@4 +FindFirstChangeNotificationA@12 +FindFirstChangeNotificationW@12 +FindFirstFileA@8 +FindFirstFileExA@24 +FindFirstFileExW@24 +FindFirstFileNameTransactedW@20 +FindFirstFileNameW@16 +FindFirstFileTransactedA@28 +FindFirstFileTransactedW@28 +FindFirstFileW@8 +FindFirstStreamTransactedW@20 +FindFirstStreamW@16 +FindFirstVolumeA@8 +FindFirstVolumeMountPointA@12 +FindFirstVolumeMountPointW@12 +FindFirstVolumeW@8 +FindNLSString@28 +FindNLSStringEx@40 +FindNextChangeNotification@4 +FindNextFileA@8 +FindNextFileNameW@12 +FindNextFileW@8 +FindNextStreamW@8 +FindNextVolumeA@12 +FindNextVolumeMountPointA@12 +FindNextVolumeMountPointW@12 +FindNextVolumeW@12 +FindPackagesByPackageFamily@28 +FindResourceA@12 +FindResourceExA@16 +FindResourceExW@16 +FindResourceW@12 +FindStringOrdinal@24 +FindVolumeClose@4 +FindVolumeMountPointClose@4 +FlsAlloc@4 +FlsFree@4 +FlsGetValue@4 +FlsSetValue@8 +FlushConsoleInputBuffer@4 +FlushFileBuffers@4 +FlushInstructionCache@12 +FlushProcessWriteBuffers@0 +FlushViewOfFile@8 +FoldStringA@20 +FoldStringW@20 +FormatApplicationUserModelId@16 +FormatMessageA@28 +FormatMessageW@28 +FreeConsole@0 +FreeEnvironmentStringsA@4 +FreeEnvironmentStringsW@4 +FreeLibrary@4 +FreeLibraryAndExitThread@8 +FreeLibraryWhenCallbackReturns@8 +FreeMemoryJobObject@4 +FreeResource@4 +FreeUserPhysicalPages@12 +FreeVirtualBuffer@4 +GenerateConsoleCtrlEvent@8 +GetACP@0 +GetActiveProcessorCount@4 +GetActiveProcessorGroupCount@0 +GetAppContainerAce@16 +GetAppContainerNamedObjectPath@20 +GetApplicationRecoveryCallback@20 +GetApplicationRecoveryCallbackWorker@20 +GetApplicationRestartSettings@16 +GetApplicationRestartSettingsWorker@16 +GetApplicationUserModelId@12 +GetAtomNameA@12 +GetAtomNameW@12 +GetBinaryType@8 +GetBinaryTypeA@8 +GetBinaryTypeW@8 +GetCPFileNameFromRegistry@12 +GetCPInfo@8 +GetCPInfoExA@12 +GetCPInfoExW@12 +GetCachedSigningLevel@24 +GetCalendarDateFormat@24 +GetCalendarDateFormatEx@24 +GetCalendarDaysInMonth@16 +GetCalendarDifferenceInDays@12 +GetCalendarInfoA@24 +GetCalendarInfoEx@28 +GetCalendarInfoW@24 +GetCalendarMonthsInYear@12 +GetCalendarSupportedDateRange@12 +GetCalendarWeekNumber@16 +GetComPlusPackageInstallStatus@0 +GetCommConfig@12 +GetCommMask@8 +GetCommModemStatus@8 +GetCommProperties@8 +GetCommState@8 +GetCommTimeouts@8 +GetCommandLineA@0 +GetCommandLineW@0 +GetCompressedFileSizeA@8 +GetCompressedFileSizeTransactedA@12 +GetCompressedFileSizeTransactedW@12 +GetCompressedFileSizeW@8 +GetComputerNameA@8 +GetComputerNameExA@12 +GetComputerNameExW@12 +GetComputerNameW@8 +GetConsoleAliasA@16 +GetConsoleAliasExesA@8 +GetConsoleAliasExesLengthA@0 +GetConsoleAliasExesLengthW@0 +GetConsoleAliasExesW@8 +GetConsoleAliasW@16 +GetConsoleAliasesA@12 +GetConsoleAliasesLengthA@4 +GetConsoleAliasesLengthW@4 +GetConsoleAliasesW@12 +GetConsoleCP@0 +GetConsoleCharType@12 +GetConsoleCommandHistoryA@12 +GetConsoleCommandHistoryLengthA@4 +GetConsoleCommandHistoryLengthW@4 +GetConsoleCommandHistoryW@12 +GetConsoleCursorInfo@8 +GetConsoleCursorMode@12 +GetConsoleDisplayMode@4 +GetConsoleFontInfo@16 +GetConsoleFontSize@8 +GetConsoleHardwareState@12 +GetConsoleHistoryInfo@4 +GetConsoleInputExeNameA@8 +GetConsoleInputExeNameW@8 +GetConsoleInputWaitHandle@0 +GetConsoleKeyboardLayoutNameA@4 +GetConsoleKeyboardLayoutNameW@4 +GetConsoleMode@8 +GetConsoleNlsMode@8 +GetConsoleOriginalTitleA@8 +GetConsoleOriginalTitleW@8 +GetConsoleOutputCP@0 +GetConsoleProcessList@8 +GetConsoleScreenBufferInfo@8 +GetConsoleScreenBufferInfoEx@8 +GetConsoleSelectionInfo@4 +GetConsoleTitleA@8 +GetConsoleTitleW@8 +GetConsoleWindow@0 +GetCurrencyFormatA@24 +GetCurrencyFormatEx@24 +GetCurrencyFormatW@24 +GetCurrentActCtx@4 +GetCurrentActCtxWorker@4 +GetCurrentApplicationUserModelId@8 +GetCurrentConsoleFont@12 +GetCurrentConsoleFontEx@12 +GetCurrentDirectoryA@8 +GetCurrentDirectoryW@8 +GetCurrentPackageFamilyName@8 +GetCurrentPackageFullName@8 +GetCurrentPackageId@8 +GetCurrentPackageInfo@16 +GetCurrentPackagePath@8 +GetCurrentProcess@0 +GetCurrentProcessId@0 +GetCurrentProcessorNumber@0 +GetCurrentProcessorNumberEx@4 +GetCurrentThread@0 +GetCurrentThreadId@0 +GetCurrentThreadStackLimits@8 +GetDateFormatA@24 +GetDateFormatAWorker@28 +GetDateFormatEx@28 +GetDateFormatW@24 +GetDateFormatWWorker@28 +GetDefaultCommConfigA@12 +GetDefaultCommConfigW@12 +GetDevicePowerState@8 +GetDiskFreeSpaceA@20 +GetDiskFreeSpaceExA@16 +GetDiskFreeSpaceExW@16 +GetDiskFreeSpaceW@20 +GetDiskSpaceInformationA@8 +GetDiskSpaceInformationW@8 +GetDllDirectoryA@8 +GetDllDirectoryW@8 +GetDriveTypeA@4 +GetDriveTypeW@4 +GetDurationFormat@32 +GetDurationFormatEx@32 +GetDynamicTimeZoneInformation@4 +GetEnabledXStateFeatures@0 +GetEncryptedFileVersionExt@8 +GetEnvironmentStrings@0 +GetEnvironmentStringsA@0 +GetEnvironmentStringsW@0 +GetEnvironmentVariableA@12 +GetEnvironmentVariableW@12 +GetEraNameCountedString@16 +GetErrorMode@0 +GetExitCodeProcess@8 +GetExitCodeThread@8 +GetExpandedNameA@8 +GetExpandedNameW@8 +GetFileAttributesA@4 +GetFileAttributesExA@12 +GetFileAttributesExW@12 +GetFileAttributesTransactedA@16 +GetFileAttributesTransactedW@16 +GetFileAttributesW@4 +GetFileBandwidthReservation@24 +GetFileInformationByHandle@8 +GetFileInformationByHandleEx@16 +GetFileMUIInfo@16 +GetFileMUIPath@28 +GetFileSize@8 +GetFileSizeEx@8 +GetFileTime@16 +GetFileType@4 +GetFinalPathNameByHandleA@16 +GetFinalPathNameByHandleW@16 +GetFirmwareEnvironmentVariableA@16 +GetFirmwareEnvironmentVariableExA@20 +GetFirmwareEnvironmentVariableExW@20 +GetFirmwareEnvironmentVariableW@16 +GetFirmwareType@4 +GetFullPathNameA@16 +GetFullPathNameTransactedA@20 +GetFullPathNameTransactedW@20 +GetFullPathNameW@16 +GetGeoInfoA@20 +GetGeoInfoEx@16 +GetGeoInfoW@20 +GetHandleContext@4 +GetHandleInformation@8 +GetLargePageMinimum@0 +GetLargestConsoleWindowSize@4 +GetLastError@0 +GetLocalTime@4 +GetLocaleInfoA@16 +GetLocaleInfoEx@16 +GetLocaleInfoW@16 +GetLogicalDriveStringsA@8 +GetLogicalDriveStringsW@8 +GetLogicalDrives@0 +GetLogicalProcessorInformation@8 +GetLogicalProcessorInformationEx@12 +GetLongPathNameA@12 +GetLongPathNameTransactedA@16 +GetLongPathNameTransactedW@16 +GetLongPathNameW@12 +GetMailslotInfo@20 +GetMaximumProcessorCount@4 +GetMaximumProcessorGroupCount@0 +GetMemoryErrorHandlingCapabilities@4 +GetModuleFileNameA@12 +GetModuleFileNameW@12 +GetModuleHandleA@4 +GetModuleHandleExA@12 +GetModuleHandleExW@12 +GetModuleHandleW@4 +GetNLSVersion@12 +GetNLSVersionEx@12 +GetNamedPipeAttribute@20 +GetNamedPipeClientComputerNameA@12 +GetNamedPipeClientComputerNameW@12 +GetNamedPipeClientProcessId@8 +GetNamedPipeClientSessionId@8 +GetNamedPipeHandleStateA@28 +GetNamedPipeHandleStateW@28 +GetNamedPipeInfo@20 +GetNamedPipeServerProcessId@8 +GetNamedPipeServerSessionId@8 +GetNativeSystemInfo@4 +GetNextVDMCommand@4 +GetNumaAvailableMemoryNode@8 +GetNumaAvailableMemoryNodeEx@8 +GetNumaHighestNodeNumber@4 +GetNumaNodeNumberFromHandle@8 +GetNumaNodeProcessorMask@8 +GetNumaNodeProcessorMaskEx@8 +GetNumaProcessorNode@8 +GetNumaProcessorNodeEx@8 +GetNumaProximityNode@8 +GetNumaProximityNodeEx@8 +GetNumberFormatA@24 +GetNumberFormatEx@24 +GetNumberFormatW@24 +GetNumberOfConsoleFonts@0 +GetNumberOfConsoleInputEvents@8 +GetNumberOfConsoleMouseButtons@4 +GetOEMCP@0 +GetOverlappedResult@16 +GetOverlappedResultEx@20 +GetPackageApplicationIds@16 +GetPackageFamilyName@12 +GetPackageFullName@12 +GetPackageId@12 +GetPackageInfo@20 +GetPackagePath@24 +GetPackagePathByFullName@12 +GetPackagesByPackageFamily@20 +GetPhysicallyInstalledSystemMemory@4 +GetPriorityClass@4 +GetPrivateProfileIntA@16 +GetPrivateProfileIntW@16 +GetPrivateProfileSectionA@16 +GetPrivateProfileSectionNamesA@12 +GetPrivateProfileSectionNamesW@12 +GetPrivateProfileSectionW@16 +GetPrivateProfileStringA@24 +GetPrivateProfileStringW@24 +GetPrivateProfileStructA@20 +GetPrivateProfileStructW@20 +GetProcAddress@8 +GetProcessAffinityMask@12 +GetProcessDEPPolicy@12 +GetProcessDefaultCpuSets@16 +GetProcessGroupAffinity@12 +GetProcessHandleCount@8 +GetProcessHeap@0 +GetProcessHeaps@8 +GetProcessId@4 +GetProcessIdOfThread@4 +GetProcessInformation@16 +GetProcessIoCounters@8 +GetProcessMitigationPolicy@16 +GetProcessPreferredUILanguages@16 +GetProcessPriorityBoost@8 +GetProcessShutdownParameters@8 +GetProcessTimes@20 +GetProcessUserModeExceptionPolicy@4 +GetProcessVersion@4 +GetProcessWorkingSetSize@12 +GetProcessWorkingSetSizeEx@16 +GetProcessorSystemCycleTime@12 +GetProductInfo@20 +GetProductName@8 +GetProfileIntA@12 +GetProfileIntW@12 +GetProfileSectionA@12 +GetProfileSectionW@12 +GetProfileStringA@20 +GetProfileStringW@20 +GetQueuedCompletionStatus@20 +GetQueuedCompletionStatusEx@24 +GetShortPathNameA@12 +GetShortPathNameW@12 +GetStagedPackagePathByFullName@12 +GetStartupInfoA@4 +GetStartupInfoW@4 +GetStateFolder@16 +GetStdHandle@4 +GetStringScripts@20 +GetStringTypeA@20 +GetStringTypeExA@20 +GetStringTypeExW@20 +GetStringTypeW@16 +GetSystemAppDataKey@16 +GetSystemCpuSetInformation@20 +GetSystemDEPPolicy@0 +GetSystemDefaultLCID@0 +GetSystemDefaultLangID@0 +GetSystemDefaultLocaleName@8 +GetSystemDefaultUILanguage@0 +GetSystemDirectoryA@8 +GetSystemDirectoryW@8 +GetSystemFileCacheSize@12 +GetSystemFirmwareTable@16 +GetSystemInfo@4 +GetSystemPowerStatus@4 +GetSystemPreferredUILanguages@16 +GetSystemRegistryQuota@8 +GetSystemTime@4 +GetSystemTimeAdjustment@12 +GetSystemTimeAsFileTime@4 +GetSystemTimePreciseAsFileTime@4 +GetSystemTimes@12 +GetSystemWindowsDirectoryA@8 +GetSystemWindowsDirectoryW@8 +GetSystemWow64DirectoryA@8 +GetSystemWow64DirectoryW@8 +GetTapeParameters@16 +GetTapePosition@20 +GetTapeStatus@4 +GetTempFileNameA@16 +GetTempFileNameW@16 +GetTempPathA@8 +GetTempPathW@8 +GetThreadContext@8 +GetThreadDescription@8 +GetThreadErrorMode@0 +GetThreadGroupAffinity@8 +GetThreadIOPendingFlag@8 +GetThreadId@4 +GetThreadIdealProcessorEx@8 +GetThreadInformation@16 +GetThreadLocale@0 +GetThreadPreferredUILanguages@16 +GetThreadPriority@4 +GetThreadPriorityBoost@8 +GetThreadSelectedCpuSets@16 +GetThreadSelectorEntry@12 +GetThreadTimes@20 +GetThreadUILanguage@0 +GetTickCount64@0 +GetTickCount@0 +GetTimeFormatA@24 +GetTimeFormatAWorker@28 +GetTimeFormatEx@24 +GetTimeFormatW@24 +GetTimeFormatWWorker@24 +GetTimeZoneInformation@4 +GetTimeZoneInformationForYear@12 +GetUILanguageInfo@20 +GetUserDefaultGeoName@8 +GetUserDefaultLCID@0 +GetUserDefaultLangID@0 +GetUserDefaultLocaleName@8 +GetUserDefaultUILanguage@0 +GetUserGeoID@4 +GetUserPreferredUILanguages@16 +GetVDMCurrentDirectories@8 +GetVersion@0 +GetVersionExA@4 +GetVersionExW@4 +GetVolumeInformationA@32 +GetVolumeInformationByHandleW@32 +GetVolumeInformationW@32 +GetVolumeNameForVolumeMountPointA@12 +GetVolumeNameForVolumeMountPointW@12 +GetVolumePathNameA@12 +GetVolumePathNameW@12 +GetVolumePathNamesForVolumeNameA@16 +GetVolumePathNamesForVolumeNameW@16 +GetWindowsDirectoryA@8 +GetWindowsDirectoryW@8 +GetWriteWatch@24 +GetXStateFeaturesMask@8 +GlobalAddAtomA@4 +GlobalAddAtomExA@8 +GlobalAddAtomExW@8 +GlobalAddAtomW@4 +GlobalAlloc@8 +GlobalCompact@4 +GlobalDeleteAtom@4 +GlobalFindAtomA@4 +GlobalFindAtomW@4 +GlobalFix@4 +GlobalFlags@4 +GlobalFree@4 +GlobalGetAtomNameA@12 +GlobalGetAtomNameW@12 +GlobalHandle@4 +GlobalLock@4 +GlobalMemoryStatus@4 +GlobalMemoryStatusEx@4 +GlobalMemoryStatusVlm@4 +GlobalReAlloc@12 +GlobalSize@4 +GlobalUnWire@4 +GlobalUnfix@4 +GlobalUnlock@4 +GlobalWire@4 +Heap32First@12 +Heap32ListFirst@8 +Heap32ListNext@8 +Heap32Next@4 +HeapAlloc@12 +HeapCompact@8 +HeapCreate@12 +HeapCreateTagsW@16 +HeapDestroy@4 +HeapExtend@16 +HeapFree@12 +HeapLock@4 +HeapQueryInformation@20 +HeapQueryTagW@20 +HeapReAlloc@16 +HeapSetInformation@16 +HeapSize@12 +HeapSummary@12 +HeapUnlock@4 +HeapUsage@20 +HeapValidate@12 +HeapWalk@8 +IdnToAscii@20 +IdnToNameprepUnicode@20 +IdnToUnicode@20 +InitAtomTable@4 +InitializeCriticalSection@4 +InitOnceBeginInitialize@16 +InitOnceComplete@12 +InitOnceExecuteOnce@16 +InitOnceInitialize@4 +InitializeConditionVariable@4 +InitializeContext2@24 +InitializeContext@16 +InitializeCriticalSection@4 +InitializeCriticalSectionAndSpinCount@8 +InitializeCriticalSectionEx@12 +InitializeEnclave@20 +InitializeProcThreadAttributeList@16 +InitializeSListHead@4 +InitializeSRWLock@4 +InitializeSynchronizationBarrier@12 +InstallELAMCertificateInfo@4 +InterlockedCompareExchange64@20 DATA ; FIXME: this is for Vista+. forwards to NTDLL.RtlInterlockedCompareExchange64@20 +InterlockedCompareExchange@12 DATA +InterlockedDecrement@4 DATA +InterlockedExchange@8 DATA +InterlockedExchangeAdd@8 DATA +InterlockedFlushSList@4 +InterlockedIncrement@4 DATA +InterlockedPopEntrySList@4 +InterlockedPushEntrySList@8 +InterlockedPushListSListEx@16 +InvalidateConsoleDIBits@8 +IsBadCodePtr@4 +IsBadHugeReadPtr@8 +IsBadHugeWritePtr@8 +IsBadReadPtr@8 +IsBadStringPtrA@8 +IsBadStringPtrW@8 +IsBadWritePtr@8 +IsCalendarLeapDay@20 +IsCalendarLeapMonth@16 +IsCalendarLeapYear@12 +IsDBCSLeadByte@4 +IsDBCSLeadByteEx@8 +IsDebuggerPresent@0 +IsEnclaveTypeSupported@4 +IsNLSDefinedString@20 +IsNativeVhdBoot@4 +IsNormalizedString@12 +IsProcessCritical@8 +IsProcessInJob@12 +IsProcessorFeaturePresent@4 +IsSystemResumeAutomatic@0 +IsThreadAFiber@0 +IsThreadpoolTimerSet@4 +IsTimeZoneRedirectionEnabled@0 +IsValidCalDateTime@8 +IsValidCodePage@4 +IsValidLanguageGroup@8 +IsValidLocale@8 +IsValidLocaleName@4 +IsValidNLSVersion@12 +IsWow64GuestMachineSupported@8 +IsWow64Process2@12 +IsWow64Process@8 +K32EmptyWorkingSet@4 +K32EnumDeviceDrivers@12 +K32EnumPageFilesA@8 +K32EnumPageFilesW@8 +K32EnumProcessModules@16 +K32EnumProcessModulesEx@20 +K32EnumProcesses@12 +K32GetDeviceDriverBaseNameA@12 +K32GetDeviceDriverBaseNameW@12 +K32GetDeviceDriverFileNameA@12 +K32GetDeviceDriverFileNameW@12 +K32GetMappedFileNameA@16 +K32GetMappedFileNameW@16 +K32GetModuleBaseNameA@16 +K32GetModuleBaseNameW@16 +K32GetModuleFileNameExA@16 +K32GetModuleFileNameExW@16 +K32GetModuleInformation@16 +K32GetPerformanceInfo@8 +K32GetProcessImageFileNameA@12 +K32GetProcessImageFileNameW@12 +K32GetProcessMemoryInfo@12 +K32GetWsChanges@12 +K32GetWsChangesEx@12 +K32InitializeProcessForWsWatch@4 +K32QueryWorkingSet@12 +K32QueryWorkingSetEx@12 +LCIDToLocaleName@16 +LCMapStringA@24 +LCMapStringEx@36 +LCMapStringW@24 +LZClose@4 +LZCloseFile@4 +LZCopy@8 +LZCreateFileW@20 +LZDone@0 +LZInit@4 +LZOpenFileA@12 +LZOpenFileW@12 +LZRead@12 +LZSeek@12 +LZStart@0 +LeaveCriticalSection@4 +LeaveCriticalSectionWhenCallbackReturns@8 +LoadAppInitDlls@0 +LoadEnclaveData@36 +LoadLibraryA@4 +LoadLibraryExA@12 +LoadLibraryExW@12 +LoadLibraryW@4 +LoadModule@8 +LoadPackagedLibrary@8 +LoadResource@8 +LoadStringBaseExW@20 +LoadStringBaseW@16 +LocalAlloc@8 +LocalCompact@4 +LocalFileTimeToFileTime@8 +LocalFileTimeToLocalSystemTime@12 +LocalFlags@4 +LocalFree@4 +LocalHandle@4 +LocalLock@4 +LocalReAlloc@12 +LocalShrink@8 +LocalSize@4 +LocalSystemTimeToLocalFileTime@12 +LocalUnlock@4 +LocaleNameToLCID@8 +LocateXStateFeature@12 +LockFile@20 +LockFileEx@24 +LockResource@4 +MapUserPhysicalPages@12 +MapUserPhysicalPagesScatter@12 +MapViewOfFile@20 +MapViewOfFileEx@24 +MapViewOfFileExNuma@28 +MapViewOfFileVlm@28 +MapViewOfFileFromApp@20 +Module32First@8 +Module32FirstW@8 +Module32Next@8 +Module32NextW@8 +MoveFileA@8 +MoveFileExA@12 +MoveFileExW@12 +MoveFileTransactedA@24 +MoveFileTransactedW@24 +MoveFileW@8 +MoveFileWithProgressA@20 +MoveFileWithProgressW@20 +MulDiv@12 +MultiByteToWideChar@24 +NeedCurrentDirectoryForExePathA@4 +NeedCurrentDirectoryForExePathW@4 +NlsCheckPolicy@8 +NlsConvertIntegerToString@20 +NlsEventDataDescCreate@16 +NlsGetCacheUpdateCount@0 +NlsUpdateLocale@8 +NlsUpdateSystemLocale@8 +NlsWriteEtwEvent@20 +NormalizeString@20 +NotifyMountMgr@12 +NotifyUILanguageChange@20 +NtVdm64CreateProcessInternalW@48 +OOBEComplete@4 +OfferVirtualMemory@12 +OpenConsoleW@16 +OpenConsoleWStub@16 +OpenEventA@12 +OpenEventW@12 +OpenFile@12 +OpenFileById@24 +OpenFileMappingA@12 +OpenFileMappingW@12 +OpenJobObjectA@12 +OpenJobObjectW@12 +OpenMutexA@12 +OpenMutexW@12 +OpenPackageInfoByFullName@12 +OpenPrivateNamespaceA@8 +OpenPrivateNamespaceW@8 +OpenProcess@12 +; MSDN says OpenProcessToken is from Advapi32.dll, not Kernel32.dll +; OpenProcessToken@12 +OpenProfileUserMapping@0 +OpenSemaphoreA@12 +OpenSemaphoreW@12 +OpenState@0 +OpenStateExplicit@8 +OpenThread@12 +OpenThreadToken@16 +OpenWaitableTimerA@12 +OpenWaitableTimerW@12 +OutputDebugStringA@4 +OutputDebugStringW@4 +PackageFamilyNameFromFullName@12 +PackageFamilyNameFromId@12 +PackageFullNameFromId@12 +PackageIdFromFullName@16 +PackageNameAndPublisherIdFromFamilyName@20 +ParseApplicationUserModelId@20 +PeekConsoleInputA@16 +PeekConsoleInputW@16 +PeekNamedPipe@24 +PostQueuedCompletionStatus@16 +PowerClearRequest@8 +PowerCreateRequest@4 +PowerSetRequest@8 +PrefetchVirtualMemory@16 +PrepareTape@12 +PrivCopyFileExW@24 +PrivMoveFileIdentityW@12 +Process32First@8 +Process32FirstW@8 +Process32Next@8 +Process32NextW@8 +ProcessIdToSessionId@8 +PssCaptureSnapshot@16 +PssDuplicateSnapshot@20 +PssFreeSnapshot@8 +PssQuerySnapshot@16 +PssWalkMarkerCreate@8 +PssWalkMarkerFree@4 +PssWalkMarkerGetPosition@8 +PssWalkMarkerRewind@4 +PssWalkMarkerSeek@8 +PssWalkMarkerSeekToBeginning@4 +PssWalkMarkerSetPosition@8 +PssWalkMarkerTell@8 +PssWalkSnapshot@20 +PulseEvent@4 +PurgeComm@8 +QueryActCtxSettingsW@28 +QueryActCtxSettingsWWorker@28 +QueryActCtxW@28 +QueryActCtxWWorker@28 +QueryDepthSList@4 +QueryDosDeviceA@12 +QueryDosDeviceW@12 +QueryFullProcessImageNameA@16 +QueryFullProcessImageNameW@16 +QueryIdleProcessorCycleTime@8 +QueryIdleProcessorCycleTimeEx@12 +QueryInformationJobObject@20 +QueryIoRateControlInformationJobObject@16 +QueryMemoryResourceNotification@8 +QueryPerformanceCounter@4 +QueryPerformanceFrequency@4 +QueryProcessAffinityUpdateMode@8 +QueryProcessCycleTime@8 +QueryProtectedPolicy@8 +QueryThreadCycleTime@8 +QueryThreadProfiling@8 +QueryThreadpoolStackInformation@8 +QueryUnbiasedInterruptTime@4 +QueueUserAPC@12 +QueueUserWorkItem@12 +QueryWin31IniFilesMappedToRegistry@16 +QuirkGetData2Worker@8 +QuirkGetDataWorker@8 +QuirkIsEnabled2Worker@12 +QuirkIsEnabled3Worker@8 +QuirkIsEnabledForPackage2Worker@24 +QuirkIsEnabledForPackage3Worker@20 +QuirkIsEnabledForPackage4Worker@20 +QuirkIsEnabledForPackageWorker@16 +QuirkIsEnabledForProcessWorker@12 +QuirkIsEnabledWorker@4 +RaiseException@16 +RaiseFailFastException@12 +RaiseInvalid16BitExeError@4 +ReOpenFile@16 +ReclaimVirtualMemory@8 +ReadConsoleA@20 +ReadConsoleInputA@16 +ReadConsoleInputExA@20 +ReadConsoleInputExW@20 +ReadConsoleInputW@16 +ReadConsoleOutputA@20 +ReadConsoleOutputAttribute@20 +ReadConsoleOutputCharacterA@20 +ReadConsoleOutputCharacterW@20 +ReadConsoleOutputW@20 +ReadConsoleW@20 +ReadDirectoryChangesExW@36 +ReadDirectoryChangesW@32 +ReadFile@20 +ReadFileEx@20 +ReadFileScatter@20 +ReadFileVlm@20 +ReadProcessMemory@20 +ReadThreadProfilingData@12 +ReclaimVirtualMemory@8 +; +; MSDN says these functions are exported +; from advapi32.dll. Commented out for +; compatibility with older versions of +; Windows. +; +; RegKrnGetGlobalState and RegKrnInitialize +; are known exceptions. +; +;RegCloseKey@4 +;RegCopyTreeW@12 +;RegCreateKeyExA@36 +;RegCreateKeyExW@36 +;RegDeleteKeyExA@16 +;RegDeleteKeyExW@16 +;RegDeleteTreeA@8 +;RegDeleteTreeW@8 +;RegDeleteValueA@8 +;RegDeleteValueW@8 +;RegDisablePredefinedCacheEx@0 +;RegEnumKeyExA@32 +;RegEnumKeyExW@32 +;RegEnumValueA@32 +;RegEnumValueW@32 +;RegFlushKey@4 +;RegGetKeySecurity@16 +;RegGetValueA@28 +;RegGetValueW@28 +;RegLoadKeyA@12 +;RegLoadKeyW@12 +;RegLoadMUIStringA@28 +;RegLoadMUIStringW@28 +;RegNotifyChangeKeyValue@20 +;RegOpenCurrentUser@8 +;RegOpenKeyExA@20 +;RegOpenKeyExW@20 +;RegOpenUserClassesRoot@16 +;RegQueryInfoKeyA@48 +;RegQueryInfoKeyW@48 +;RegQueryValueExA@24 +;RegQueryValueExW@24 +;RegRestoreKeyA@12 +;RegRestoreKeyW@12 +;RegSaveKeyExA@16 +;RegSaveKeyExW@16 +;RegSetKeySecurity@12 +;RegSetValueExA@24 +;RegSetValueExW@24 +;RegUnLoadKeyA@8 +;RegUnLoadKeyW@8 +RegisterApplicationRecoveryCallback@16 +RegisterApplicationRestart@8 +RegisterBadMemoryNotification@4 +RegisterConsoleIME@8 +RegisterConsoleOS2@4 +RegisterConsoleVDM@44 +RegisterWaitForInputIdle@4 +RegisterWaitForSingleObject@24 +RegisterWaitForSingleObjectEx@20 +RegisterWaitUntilOOBECompleted@12 +RegisterWowBaseHandlers@4 +RegisterWowExec@4 +ReleaseActCtx@4 +ReleaseActCtxWorker@4 +ReleaseMutex@4 +ReleaseMutexWhenCallbackReturns@8 +ReleaseSRWLockExclusive@4 +ReleaseSRWLockShared@4 +ReleaseSemaphore@12 +ReleaseSemaphoreWhenCallbackReturns@12 +ResolveLocaleName@12 +RemoveDirectoryA@4 +RemoveDirectoryTransactedA@8 +RemoveDirectoryTransactedW@8 +RemoveDirectoryW@4 +RemoveDllDirectory@4 +RemoveLocalAlternateComputerNameA@8 +RemoveLocalAlternateComputerNameW@8 +RemoveSecureMemoryCacheCallback@4 +RemoveVectoredContinueHandler@4 +RemoveVectoredExceptionHandler@4 +ReplaceFile@24 +ReplaceFileA@24 +ReplaceFileW@24 +ReplacePartitionUnit@12 +RequestDeviceWakeup@4 +RequestWakeupLatency@4 +ResetEvent@4 +ResetWriteWatch@8 +ResizePseudoConsole@8 +ResolveDelayLoadedAPI@24 +ResolveDelayLoadsFromDll@12 +ResolveLocaleName@12 +RestoreLastError@4 +ResumeThread@4 +RtlCaptureContext@4 +RtlCaptureStackBackTrace@16 +RtlFillMemory@12 +RtlMoveMemory@12 +RtlPcToFileHeader@8 +RtlUnwind@16 +RtlZeroMemory@8 +ScrollConsoleScreenBufferA@20 +ScrollConsoleScreenBufferW@20 +SearchPathA@24 +SearchPathW@24 +SetCachedSigningLevel@16 +SetCalendarInfoA@16 +SetCalendarInfoW@16 +SetClientTimeZoneInformation@4 +SetComPlusPackageInstallStatus@4 +SetCommBreak@4 +SetCommConfig@12 +SetCommMask@8 +SetCommState@8 +SetCommTimeouts@8 +SetComputerNameA@4 +SetComputerNameEx2W@12 +SetComputerNameExA@8 +SetComputerNameExW@8 +SetComputerNameW@4 +SetConsoleActiveScreenBuffer@4 +SetConsoleCP@4 +SetConsoleCommandHistoryMode@4 +SetConsoleCtrlHandler@8 +SetConsoleCursor@8 +SetConsoleCursorInfo@8 +SetConsoleCursorMode@12 +SetConsoleCursorPosition@8 +SetConsoleDisplayMode@12 +SetConsoleFont@8 +SetConsoleHardwareState@12 +SetConsoleHistoryInfo@4 +SetConsoleIcon@4 +SetConsoleInputExeNameA@4 +SetConsoleInputExeNameW@4 +SetConsoleKeyShortcuts@16 +SetConsoleLocalEUDC@16 +SetConsoleMaximumWindowSize@8 +SetConsoleMenuClose@4 +SetConsoleMode@8 +SetConsoleNlsMode@8 +SetConsoleNumberOfCommandsA@8 +SetConsoleNumberOfCommandsW@8 +SetConsoleOS2OemFormat@4 +SetConsoleOutputCP@4 +SetConsolePalette@12 +SetConsoleScreenBufferInfoEx@8 +SetConsoleScreenBufferSize@8 +SetConsoleTextAttribute@8 +SetConsoleTitleA@4 +SetConsoleTitleW@4 +SetConsoleWindowInfo@12 +SetCriticalSectionSpinCount@8 +SetCurrentConsoleFontEx@12 +SetCurrentDirectoryA@4 +SetCurrentDirectoryW@4 +SetDefaultCommConfigA@12 +SetDefaultCommConfigW@12 +SetDefaultDllDirectories@4 +SetDllDirectoryA@4 +SetDllDirectoryW@4 +SetDynamicTimeZoneInformation@4 +SetEndOfFile@4 +SetEnvironmentStringsA@4 +SetEnvironmentStringsW@4 +SetEnvironmentVariableA@8 +SetEnvironmentVariableW@8 +SetErrorMode@4 +SetEvent@4 +SetEventWhenCallbackReturns@8 +SetFileApisToANSI@0 +SetFileApisToOEM@0 +SetFileAttributesA@8 +SetFileAttributesTransactedA@12 +SetFileAttributesTransactedW@12 +SetFileAttributesW@8 +SetFileBandwidthReservation@24 +SetFileCompletionNotificationModes@8 +SetFileInformationByHandle@16 +SetFileIoOverlappedRange@12 +SetFilePointer@16 +SetFilePointerEx@20 +SetFileShortNameA@8 +SetFileShortNameW@8 +SetFileTime@16 +SetFileValidData@12 +SetFirmwareEnvironmentVariableA@16 +SetFirmwareEnvironmentVariableExA@20 +SetFirmwareEnvironmentVariableExW@20 +SetFirmwareEnvironmentVariableW@16 +SetHandleContext@8 +SetHandleCount@4 +SetHandleInformation@12 +SetInformationJobObject@16 +SetIoRateControlInformationJobObject@8 +SetLastConsoleEventActive@0 +SetLastError@4 +SetLocalPrimaryComputerNameA@8 +SetLocalPrimaryComputerNameW@8 +SetLocalTime@4 +SetLocaleInfoA@12 +SetLocaleInfoW@12 +SetMailslotInfo@8 +SetMessageWaitingIndicator@8 +SetNamedPipeAttribute@20 +SetNamedPipeHandleState@16 +SetPriorityClass@8 +SetProcessAffinityMask@8 +SetProcessAffinityUpdateMode@8 +SetProcessDEPPolicy@4 +SetProcessDefaultCpuSets@12 +SetProcessInformation@16 +SetProcessMitigationPolicy@12 +SetProcessPreferredUILanguages@12 +SetProcessPriorityBoost@8 +SetProcessShutdownParameters@8 +SetProcessUserModeExceptionPolicy@4 +SetProcessWorkingSetSize@12 +SetProcessWorkingSetSizeEx@16 +SetProtectedPolicy@12 +SetSearchPathMode@4 +SetStdHandle@8 +SetStdHandleEx@12 +SetSystemFileCacheSize@12 +SetSystemPowerState@8 +SetSystemTime@4 +SetSystemTimeAdjustment@8 +SetTapeParameters@12 +SetTapePosition@24 +SetTermsrvAppInstallMode@4 +SetThreadAffinityMask@8 +SetThreadContext@8 +SetThreadDescription@8 +SetThreadErrorMode@8 +SetThreadExecutionState@4 +SetThreadGroupAffinity@12 +SetThreadIdealProcessor@8 +SetThreadIdealProcessorEx@12 +SetThreadInformation@16 +SetThreadLocale@4 +SetThreadPreferredUILanguages@12 +SetThreadPriority@8 +SetThreadPriorityBoost@8 +SetThreadSelectedCpuSets@12 +SetThreadStackGuarantee@4 +SetThreadToken@8 +SetThreadUILanguage@4 +SetThreadpoolStackInformation@8 +SetThreadpoolThreadMaximum@8 +SetThreadpoolThreadMinimum@8 +SetThreadpoolTimer@16 +SetThreadpoolTimerEx@16 +SetThreadpoolWait@12 +SetThreadpoolWaitEx@16 +SetTimeZoneInformation@4 +SetTimerQueueTimer@24 +SetUnhandledExceptionFilter@4 +SetUserGeoID@4 +SetUserGeoName@4 +SetVDMCurrentDirectories@8 +SetVolumeLabelA@8 +SetVolumeLabelW@8 +SetVolumeMountPointA@8 +SetVolumeMountPointW@8 +SetVolumeMountPointWStub@8 +SetWaitableTimer@24 +SetWaitableTimerEx@28 +SetXStateFeaturesMask@12 +SetupComm@12 +ShowConsoleCursor@8 +SignalObjectAndWait@16 +SizeofResource@8 +Sleep@4 +SleepConditionVariableCS@12 +SleepConditionVariableSRW@16 +SleepEx@8 +SortCloseHandle@4 +SortGetHandle@12 +StartThreadpoolIo@4 +SubmitThreadpoolWork@4 +SuspendThread@4 +SwitchToFiber@4 +SwitchToThread@0 +SystemTimeToFileTime@8 +SystemTimeToTzSpecificLocalTime@12 +SystemTimeToTzSpecificLocalTimeEx@12 +TerminateJobObject@8 +TerminateProcess@8 +TerminateThread@8 +TermsrvAppInstallMode@0 +TermsrvConvertSysRootToUserDir@8 +TermsrvCreateRegEntry@20 +TermsrvDeleteKey@4 +TermsrvDeleteValue@8 +TermsrvGetPreSetValue@16 +TermsrvGetWindowsDirectoryA@8 +TermsrvGetWindowsDirectoryW@8 +TermsrvOpenRegEntry@12 +TermsrvOpenUserClasses@8 +TermsrvRestoreKey@12 +TermsrvSetKeySecurity@12 +TermsrvSetValueKey@24 +TermsrvSyncUserIniFileExt@4 +Thread32First@8 +Thread32Next@8 +TlsAlloc@0 +TlsFree@4 +TlsGetValue@4 +TlsSetValue@8 +Toolhelp32ReadProcessMemory@20 +TransactNamedPipe@28 +TransmitCommChar@8 +TrimVirtualBuffer@4 +TryAcquireSRWLockExclusive@4 +TryAcquireSRWLockShared@4 +TryEnterCriticalSection@4 +TrySubmitThreadpoolCallback@12 +TzSpecificLocalTimeToSystemTime@12 +TzSpecificLocalTimeToSystemTimeEx@12 +UTRegister@28 +UTUnRegister@4 +UnhandledExceptionFilter@4 +UnlockFile@20 +UnlockFileEx@20 +UnmapViewOfFile@4 +UnmapViewOfFileVlm@4 +UnregisterApplicationRecoveryCallback@0 +UnregisterApplicationRestart@0 +UnregisterBadMemoryNotification@4 +UnregisterConsoleIME@0 +UnregisterWait@4 +UnregisterWaitEx@8 +UnregisterWaitUntilOOBECompleted@4 +UpdateCalendarDayOfWeek@4 +UpdateProcThreadAttribute@28 +UpdateResourceA@24 +UpdateResourceW@24 +VDMConsoleOperation@8 +VDMOperationStarted@4 +VerLanguageNameA@12 +VerLanguageNameW@12 +VerSetConditionMask@16 +VerifyConsoleIoHandle@4 +VerifyScripts@20 +VerifyVersionInfoA@16 +VerifyVersionInfoW@16 +VirtualAlloc@16 +VirtualAllocEx@20 +VirtualAllocExNuma@24 +VirtualAllocVlm@24 +VirtualBufferExceptionHandler@12 +VirtualFree@12 +VirtualFreeEx@16 +VirtualFreeVlm@20 +VirtualLock@8 +VirtualProtect@16 +VirtualProtectEx@20 +VirtualProtectVlm@24 +VirtualQuery@12 +VirtualQueryEx@16 +VirtualQueryVlm@16 +VirtualUnlock@8 +WTSGetActiveConsoleSessionId@0 +WaitCommEvent@12 +WaitForDebugEvent@8 +WaitForMultipleObjects@16 +WaitForMultipleObjectsEx@20 +WaitForSingleObject@8 +WaitForSingleObjectEx@12 +WaitForThreadpoolIoCallbacks@8 +WaitForThreadpoolTimerCallbacks@8 +WaitForThreadpoolWaitCallbacks@8 +WaitForThreadpoolWorkCallbacks@8 +WaitNamedPipeA@8 +WaitNamedPipeW@8 +WakeAllConditionVariable@4 +WakeConditionVariable@4 +WerGetFlags@8 +WerGetFlagsWorker@8 +WerRegisterAdditionalProcess@8 +WerRegisterAppLocalDump@4 +WerRegisterCustomMetadata@8 +WerRegisterExcludedMemoryBlock@8 +WerRegisterFile@12 +WerRegisterFileWorker@12 +WerRegisterMemoryBlock@8 +WerRegisterMemoryBlockWorker@8 +WerRegisterRuntimeExceptionModule@8 +WerRegisterRuntimeExceptionModuleWorker@8 +WerSetFlags@4 +WerSetFlagsWorker@4 +WerUnregisterAdditionalProcess@4 +WerUnregisterAppLocalDump +WerUnregisterCustomMetadata@4 +WerUnregisterExcludedMemoryBlock@4 +WerUnregisterFile@4 +WerUnregisterFileWorker@4 +WerUnregisterMemoryBlock@4 +WerUnregisterMemoryBlockWorker@4 +WerUnregisterRuntimeExceptionModule@8 +WerUnregisterRuntimeExceptionModuleWorker@8 +WerpCleanupMessageMapping@0 +WerpGetDebugger@8 +WerpInitiateRemoteRecovery@4 +WerpNotifyLoadStringResource@16 +WerpNotifyLoadStringResourceEx@20 +WerpNotifyUseStringResource@4 +WerpStringLookup@8 +WideCharToMultiByte@32 +WinExec@8 +Wow64DisableWow64FsRedirection@4 +Wow64EnableWow64FsRedirection@4 +Wow64GetThreadContext@8 +Wow64GetThreadSelectorEntry@12 +Wow64RevertWow64FsRedirection@4 +Wow64SetThreadContext@8 +Wow64SuspendThread@4 +WriteConsoleA@20 +WriteConsoleInputA@16 +WriteConsoleInputVDMA@16 +WriteConsoleInputVDMW@16 +WriteConsoleInputW@16 +WriteConsoleOutputA@20 +WriteConsoleOutputAttribute@20 +WriteConsoleOutputCharacterA@20 +WriteConsoleOutputCharacterW@20 +WriteConsoleOutputW@20 +WriteConsoleW@20 +WriteFile@20 +WriteFileEx@20 +WriteFileGather@20 +WriteFileVlm@20 +WritePrivateProfileSectionA@12 +WritePrivateProfileSectionW@12 +WritePrivateProfileStringA@16 +WritePrivateProfileStringW@16 +WritePrivateProfileStructA@20 +WritePrivateProfileStructW@20 +WriteProcessMemory@20 +WriteProcessMemoryVlm@20 +WriteProfileSectionA@8 +WriteProfileSectionW@8 +WriteProfileStringA@12 +WriteProfileStringW@12 +WriteTapemark@16 +WTSGetActiveConsoleSessionId@0 +ZombifyActCtx@4 +ZombifyActCtxWorker@4 +_hread@12 +_hwrite@12 +_lclose@4 +_lcreat@8 +_llseek@12 +_lopen@8 +_lread@12 +_lwrite@12 +lstrcat@8 +lstrcatA@8 +lstrcatW@8 +lstrcmp@8 +lstrcmpA@8 +lstrcmpW@8 +lstrcmpi@8 +lstrcmpiA@8 +lstrcmpiW@8 +lstrcpy@8 +lstrcpyA@8 +lstrcpyW@8 +lstrcpyn@12 +lstrcpynA@12 +lstrcpynW@12 +lstrlen@4 +lstrlenA@4 +lstrlenW@4 +; +; MSDN says these functions are exported +; from winmm.dll. Commented out for +; compatibility with older versions of +; Windows. +; +;timeBeginPeriod@4 +;timeEndPeriod@4 +;timeGetDevCaps@8 +;timeGetSystemTime@8 +;timeGetTime@0 diff --git a/lib/libc/mingw/lib32/ole32.def b/lib/libc/mingw/lib32/ole32.def new file mode 100644 index 0000000000..7f5b37c574 --- /dev/null +++ b/lib/libc/mingw/lib32/ole32.def @@ -0,0 +1,405 @@ +; +; Definition file of ole32.dll +; Automatic generated by gendef +; written by Kai Tietz 2008 +; +LIBRARY "ole32.dll" +EXPORTS +CoVrfCheckThreadState@4 +CoVrfGetThreadState@4 +CoVrfReleaseThreadState@4 +HRGN_UserFree@8 +HRGN_UserMarshal@12 +HRGN_UserSize@12 +HRGN_UserUnmarshal@12 +NdrOleInitializeExtension@8 +PropVariantChangeType@20 +BindMoniker@16 +CLIPFORMAT_UserFree@8 +CLIPFORMAT_UserMarshal@12 +CLIPFORMAT_UserSize@12 +CLIPFORMAT_UserUnmarshal@12 +CLSIDFromOle1Class@12 +CLSIDFromProgID@8 +CLSIDFromProgIDEx@8 +CLSIDFromString@8 +CoAddRefServerProcess@0 +CoAllowSetForegroundWindow@8 +CoBuildVersion@0 +CoCancelCall@8 +CoCopyProxy@8 +CoCreateFreeThreadedMarshaler@8 +CoCreateGuid@4 +CoCreateInstance@20 +CoCreateInstanceEx@24 +CoCreateInstanceFromApp@24 +CoCreateObjectInContext@16 +CoDeactivateObject@8 +CoDisableCallCancellation@4 +CoDisconnectContext@4 +CoDisconnectObject@8 +CoDosDateTimeToFileTime@12 +CoEnableCallCancellation@4 +CoFileTimeNow@4 +CoFileTimeToDosDateTime@12 +CoFreeAllLibraries@0 +CoFreeLibrary@4 +CoFreeUnusedLibraries@0 +CoFreeUnusedLibrariesEx@8 +CoGetActivationState@24 +CoGetApartmentID@8 +CoGetApartmentType@8 +CoGetCallContext@8 +CoGetCallState@8 +CoGetCallerTID@4 +CoGetCancelObject@12 +CoGetClassObject@20 +CoGetClassVersion@12 +CoGetComCatalog@8 +CoGetContextToken@4 +CoGetCurrentLogicalThreadId@4 +CoGetCurrentProcess@0 +CoGetDefaultContext@12 +CoGetInstanceFromFile@32 +CoGetInstanceFromIStorage@28 +CoGetInterceptor@16 +CoGetInterceptorFromTypeInfo@20 +CoGetInterfaceAndReleaseStream@12 +CoGetMalloc@8 +CoGetMarshalSizeMax@24 +CoGetModuleType@8 +CoGetObject@16 +CoGetObjectContext@8 +CoGetPSClsid@8 +CoGetProcessIdentifier@4 +CoGetStandardMarshal@24 +CoGetState@4 +CoGetStdMarshalEx@12 +CoGetSystemSecurityPermissions@8 +CoGetTreatAsClass@8 +CoImpersonateClient@0 +CoInitialize@4 +CoInitializeEx@8 +CoInitializeSecurity@36 +CoInitializeWOW@8 +CoInstall@20 +CoInvalidateRemoteMachineBindings@4 +CoIsHandlerConnected@4 +CoIsOle1Class@4 +CoLoadLibrary@8 +CoLockObjectExternal@12 +CoMarshalHresult@8 +CoMarshalInterThreadInterfaceInStream@12 +CoMarshalInterface@24 +CoPopServiceDomain@4 +CoPushServiceDomain@4 +CoQueryAuthenticationServices@8 +CoQueryClientBlanket@28 +CoQueryProxyBlanket@32 +CoQueryReleaseObject@4 +CoReactivateObject@8 +CoRegisterChannelHook@8 +CoRegisterClassObject@20 +CoRegisterInitializeSpy@8 +CoRegisterMallocSpy@4 +CoRegisterMessageFilter@8 +CoRegisterPSClsid@8 +CoRegisterSurrogate@4 +CoRegisterSurrogateEx@8 +CoReleaseMarshalData@4 +CoReleaseServerProcess@0 +CoResumeClassObjects@0 +CoRetireServer@4 +CoRevertToSelf@0 +CoRevokeClassObject@4 +CoRevokeInitializeSpy@8 +CoRevokeMallocSpy@0 +CoSetCancelObject@4 +CoSetProxyBlanket@32 +CoSetState@4 +CoSuspendClassObjects@0 +CoSwitchCallContext@8 +CoTaskMemAlloc@4 +CoTaskMemFree@4 +CoTaskMemRealloc@8 +CoTestCancel@0 +CoTreatAsClass@8 +CoUninitialize@0 +CoUnloadingWOW@4 +CoUnmarshalHresult@8 +CoUnmarshalInterface@12 +CoWaitForMultipleHandles@20 +ComPs_NdrDllCanUnloadNow@4 +ComPs_NdrDllGetClassObject@24 +ComPs_NdrDllRegisterProxy@20 +ComPs_NdrDllUnregisterProxy@20 +CreateAntiMoniker@4 +CreateBindCtx@8 +CreateClassMoniker@8 +CreateDataAdviseHolder@4 +CreateDataCache@16 +CreateErrorInfo@4 +CreateFileMoniker@8 +CreateGenericComposite@12 +CreateILockBytesOnHGlobal@12 +CreateItemMoniker@12 +CreateObjrefMoniker@8 +CreateOleAdviseHolder@4 +CreatePointerMoniker@8 +CreateStdProgressIndicator@16 +CreateStreamOnHGlobal@12 +DcomChannelSetHResult@12 +DllDebugObjectRPCHook@8 +DllGetClassObject@12 +DllGetClassObjectWOW@12 +DllRegisterServer@0 +DoDragDrop@16 +EnableHookObject@8 +FmtIdToPropStgName@8 +FreePropVariantArray@8 +GetClassFile@8 +GetConvertStg@4 +GetDocumentBitStg@4 +GetErrorInfo@8 +GetHGlobalFromILockBytes@8 +GetHGlobalFromStream@8 +GetHookInterface@4 +GetRunningObjectTable@8 +HACCEL_UserFree@8 +HACCEL_UserMarshal@12 +HACCEL_UserSize@12 +HACCEL_UserUnmarshal@12 +HBITMAP_UserFree@8 +HBITMAP_UserMarshal@12 +HBITMAP_UserSize@12 +HBITMAP_UserUnmarshal@12 +HBRUSH_UserFree@8 +HBRUSH_UserMarshal@12 +HBRUSH_UserSize@12 +HBRUSH_UserUnmarshal@12 +HDC_UserFree@8 +HDC_UserMarshal@12 +HDC_UserSize@12 +HDC_UserUnmarshal@12 +HENHMETAFILE_UserFree@8 +HENHMETAFILE_UserMarshal@12 +HENHMETAFILE_UserSize@12 +HENHMETAFILE_UserUnmarshal@12 +HGLOBAL_UserFree@8 +HGLOBAL_UserMarshal@12 +HGLOBAL_UserSize@12 +HGLOBAL_UserUnmarshal@12 +HICON_UserFree@8 +HICON_UserMarshal@12 +HICON_UserSize@12 +HICON_UserUnmarshal@12 +HMENU_UserFree@8 +HMENU_UserMarshal@12 +HMENU_UserSize@12 +HMENU_UserUnmarshal@12 +HMETAFILEPICT_UserFree@8 +HMETAFILEPICT_UserMarshal@12 +HMETAFILEPICT_UserSize@12 +HMETAFILEPICT_UserUnmarshal@12 +HMETAFILE_UserFree@8 +HMETAFILE_UserMarshal@12 +HMETAFILE_UserSize@12 +HMETAFILE_UserUnmarshal@12 +HPALETTE_UserFree@8 +HPALETTE_UserMarshal@12 +HPALETTE_UserSize@12 +HPALETTE_UserUnmarshal@12 +HWND_UserFree@8 +HWND_UserMarshal@12 +HWND_UserSize@12 +HWND_UserUnmarshal@12 +HkOleRegisterObject@16 +IIDFromString@8 +IsAccelerator@16 +IsEqualGUID@8 +IsValidIid@4 +IsValidInterface@4 +IsValidPtrIn@8 +IsValidPtrOut@8 +MkParseDisplayName@16 +MonikerCommonPrefixWith@12 +MonikerRelativePathTo@16 +;NdrProxyForwardingFunction10 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction11 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction12 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction13 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction14 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction15 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction16 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction17 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction18 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction19 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction20 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction21 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction22 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction23 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction24 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction25 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction26 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction27 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction28 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction29 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction30 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction31 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction32 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction3 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction4 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction5 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction6 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction7 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction8 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;NdrProxyForwardingFunction9 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient10 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient11 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient12 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient13 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient14 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient15 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient16 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient17 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient18 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient19 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient20 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient21 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient22 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient23 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient24 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient25 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient26 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient27 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient28 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient29 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient30 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient31 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient32 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient3 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient4 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient5 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient6 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient7 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient8 ; Check!!! Couldn't determine function argument count. Function doesn't return. +;ObjectStublessClient9 ; Check!!! Couldn't determine function argument count. Function doesn't return. +OleBuildVersion@0 +OleConvertIStorageToOLESTREAM@8 +OleConvertIStorageToOLESTREAMEx@28 +OleConvertOLESTREAMToIStorage@12 +OleConvertOLESTREAMToIStorageEx@28 +OleCreate@28 +OleCreateDefaultHandler@16 +OleCreateEmbeddingHelper@24 +OleCreateEx@48 +OleCreateFromData@28 +OleCreateFromDataEx@48 +OleCreateFromFile@32 +OleCreateFromFileEx@52 +OleCreateLink@28 +OleCreateLinkEx@48 +OleCreateLinkFromData@28 +OleCreateLinkFromDataEx@48 +OleCreateLinkToFile@28 +OleCreateLinkToFileEx@48 +OleCreateMenuDescriptor@8 +OleCreateStaticFromData@28 +OleDestroyMenuDescriptor@4 +OleDoAutoConvert@8 +OleDraw@16 +OleDuplicateData@12 +OleFlushClipboard@0 +OleGetAutoConvert@8 +OleGetClipboard@4 +OleGetIconOfClass@12 +OleGetIconOfFile@8 +OleInitialize@4 +OleInitializeWOW@8 +OleIsCurrentClipboard@4 +OleIsRunning@4 +OleLoad@16 +OleLoadFromStream@12 +OleLockRunning@12 +OleMetafilePictFromIconAndLabel@16 +OleNoteObjectVisible@8 +OleQueryCreateFromData@4 +OleQueryLinkFromData@4 +OleRegEnumFormatEtc@12 +OleRegEnumVerbs@8 +OleRegGetMiscStatus@12 +OleRegGetUserType@12 +OleRun@4 +OleSave@12 +OleSaveToStream@8 +OleSetAutoConvert@8 +OleSetClipboard@4 +OleSetContainedObject@8 +OleSetMenuDescriptor@20 +OleTranslateAccelerator@12 +OleUninitialize@0 +OpenOrCreateStream@12 +ProgIDFromCLSID@8 +PropStgNameToFmtId@8 +PropSysAllocString@4 +PropSysFreeString@4 +PropVariantClear@4 +PropVariantCopy@8 +ReadClassStg@8 +ReadClassStm@8 +ReadFmtUserTypeStg@12 +ReadOleStg@24 +ReadStringStream@8 +RegisterDragDrop@8 +ReleaseStgMedium@4 +RevokeDragDrop@4 +SNB_UserFree@8 +SNB_UserMarshal@12 +SNB_UserSize@12 +SNB_UserUnmarshal@12 +STGMEDIUM_UserFree@8 +STGMEDIUM_UserMarshal@12 +STGMEDIUM_UserSize@12 +STGMEDIUM_UserUnmarshal@12 +SetConvertStg@8 +SetDocumentBitStg@8 +SetErrorInfo@8 +StgConvertPropertyToVariant@16 +StgConvertVariantToProperty@28 +StgCreateDocfile@16 +StgCreateDocfileOnILockBytes@16 +StgCreatePropSetStg@12 +StgCreatePropStg@24 +StgCreateStorageEx@32 +StgGetIFillLockBytesOnFile@8 +StgGetIFillLockBytesOnILockBytes@8 +StgIsStorageFile@4 +StgIsStorageILockBytes@4 +StgOpenAsyncDocfileOnIFillLockBytes@16 +StgOpenPropStg@20 +StgOpenStorage@24 +StgOpenStorageEx@32 +StgOpenStorageOnHandle@24 +StgOpenStorageOnILockBytes@24 +StgPropertyLengthAsVariant@16 +StgSetTimes@16 +StgCreateStorageEx@32 +StgOpenStorageEx@32 +StringFromCLSID@8 +StringFromGUID2@12 +StringFromIID@8 +UpdateDCOMSettings@0 +UpdateProcessTracing@8 +UtConvertDvtd16toDvtd32@12 +UtConvertDvtd32toDvtd16@12 +UtGetDvtd16Info@8 +UtGetDvtd32Info@8 +WdtpInterfacePointer_UserFree@4 +WdtpInterfacePointer_UserMarshal@20 +WdtpInterfacePointer_UserSize@20 +WdtpInterfacePointer_UserUnmarshal@16 +WriteClassStg@8 +WriteClassStm@8 +WriteFmtUserTypeStg@12 +WriteOleStg@16 +WriteStringStream@8 diff --git a/lib/libc/mingw/lib32/oleaut32.def b/lib/libc/mingw/lib32/oleaut32.def new file mode 100644 index 0000000000..c0b69ebc40 --- /dev/null +++ b/lib/libc/mingw/lib32/oleaut32.def @@ -0,0 +1,427 @@ +; +; Definition file of OLEAUT32.dll +; Automatic generated by gendef +; written by Kai Tietz 2008 +; +LIBRARY "OLEAUT32.dll" +EXPORTS +SysAllocString@4 +SysReAllocString@8 +SysAllocStringLen@8 +SysReAllocStringLen@12 +SysFreeString@4 +SysStringLen@4 +VariantInit@4 +VariantClear@4 +VariantCopy@8 +VariantCopyInd@8 +VariantChangeType@16 +VariantTimeToDosDateTime@16 +DosDateTimeToVariantTime@12 +SafeArrayCreate@12 +SafeArrayDestroy@4 +SafeArrayGetDim@4 +SafeArrayGetElemsize@4 +SafeArrayGetUBound@12 +SafeArrayGetLBound@12 +SafeArrayLock@4 +SafeArrayUnlock@4 +SafeArrayAccessData@8 +SafeArrayUnaccessData@4 +SafeArrayGetElement@12 +SafeArrayPutElement@12 +SafeArrayCopy@8 +DispGetParam@20 +DispGetIDsOfNames@16 +DispInvoke@32 +CreateDispTypeInfo@12 +CreateStdDispatch@16 +RegisterActiveObject@16 +RevokeActiveObject@8 +GetActiveObject@12 +SafeArrayAllocDescriptor@8 +SafeArrayAllocData@4 +SafeArrayDestroyDescriptor@4 +SafeArrayDestroyData@4 +SafeArrayRedim@8 +SafeArrayAllocDescriptorEx@12 +SafeArrayCreateEx@16 +SafeArrayCreateVectorEx@16 +SafeArraySetRecordInfo@8 +SafeArrayGetRecordInfo@8 +VarParseNumFromStr@20 +VarNumFromParseNum@16 +VarI2FromUI1@8 +VarI2FromI4@8 +VarI2FromR4@8 +VarI2FromR8@12 +VarI2FromCy@12 +VarI2FromDate@12 +VarI2FromStr@16 +VarI2FromDisp@12 +VarI2FromBool@8 +SafeArraySetIID@8 +VarI4FromUI1@8 +VarI4FromI2@8 +VarI4FromR4@8 +VarI4FromR8@12 +VarI4FromCy@12 +VarI4FromDate@12 +VarI4FromStr@16 +VarI4FromDisp@12 +VarI4FromBool@8 +SafeArrayGetIID@8 +VarR4FromUI1@8 +VarR4FromI2@8 +VarR4FromI4@8 +VarR4FromR8@12 +VarR4FromCy@12 +VarR4FromDate@12 +VarR4FromStr@16 +VarR4FromDisp@12 +VarR4FromBool@8 +SafeArrayGetVartype@8 +VarR8FromUI1@8 +VarR8FromI2@8 +VarR8FromI4@8 +VarR8FromR4@8 +VarR8FromCy@12 +VarR8FromDate@12 +VarR8FromStr@16 +VarR8FromDisp@12 +VarR8FromBool@8 +VarFormat@24 +VarDateFromUI1@8 +VarDateFromI2@8 +VarDateFromI4@8 +VarDateFromR4@8 +VarDateFromR8@12 +VarDateFromCy@12 +VarDateFromStr@16 +VarDateFromDisp@12 +VarDateFromBool@8 +VarFormatDateTime@16 +VarCyFromUI1@8 +VarCyFromI2@8 +VarCyFromI4@8 +VarCyFromR4@8 +VarCyFromR8@12 +VarCyFromDate@12 +VarCyFromStr@16 +VarCyFromDisp@12 +VarCyFromBool@8 +VarFormatNumber@28 +VarBstrFromUI1@16 +VarBstrFromI2@16 +VarBstrFromI4@16 +VarBstrFromR4@16 +VarBstrFromR8@20 +VarBstrFromCy@20 +VarBstrFromDate@20 +VarBstrFromDisp@16 +VarBstrFromBool@16 +VarFormatPercent@28 +VarBoolFromUI1@8 +VarBoolFromI2@8 +VarBoolFromI4@8 +VarBoolFromR4@8 +VarBoolFromR8@12 +VarBoolFromDate@12 +VarBoolFromCy@12 +VarBoolFromStr@16 +VarBoolFromDisp@12 +VarFormatCurrency@28 +VarWeekdayName@20 +VarMonthName@16 +VarUI1FromI2@8 +VarUI1FromI4@8 +VarUI1FromR4@8 +VarUI1FromR8@12 +VarUI1FromCy@12 +VarUI1FromDate@12 +VarUI1FromStr@16 +VarUI1FromDisp@12 +VarUI1FromBool@8 +VarFormatFromTokens@24 +VarTokenizeFormatString@28 +VarAdd@12 +VarAnd@12 +VarDiv@12 +;DllCanUnloadNow@0 +DllGetClassObject@12 +DispCallFunc@32 +VariantChangeTypeEx@20 +SafeArrayPtrOfIndex@12 +SysStringByteLen@4 +SysAllocStringByteLen@8 +DllRegisterServer@0 +VarEqv@12 +VarIdiv@12 +VarImp@12 +VarMod@12 +VarMul@12 +VarOr@12 +VarPow@12 +VarSub@12 +CreateTypeLib@12 +LoadTypeLib@8 +LoadRegTypeLib@20 +RegisterTypeLib@12 +QueryPathOfRegTypeLib@20 +LHashValOfNameSys@12 +LHashValOfNameSysA@12 +VarXor@12 +VarAbs@8 +VarFix@8 +OaBuildVersion@0 +ClearCustData@4 +VarInt@8 +VarNeg@8 +VarNot@8 +VarRound@12 +VarCmp@16 +VarDecAdd@12 +VarDecDiv@12 +VarDecMul@12 +CreateTypeLib2@12 +VarDecSub@12 +VarDecAbs@8 +LoadTypeLibEx@12 +SystemTimeToVariantTime@8 +VariantTimeToSystemTime@12 +UnRegisterTypeLib@20 +UserBSTR_free_inst@4 +UserBSTR_free_local@4 +UserBSTR_from_local@8 +UserBSTR_to_local@8 +UserEXCEPINFO_free_inst@4 +UserEXCEPINFO_free_local@4 +UserEXCEPINFO_from_local@8 +UserEXCEPINFO_to_local@8 +UserHWND_free_inst@4 +UserHWND_free_local@4 +UserHWND_from_local@8 +UserHWND_to_local@8 +UserMSG_free_inst@4 +UserMSG_free_local@4 +UserMSG_from_local@8 +UserMSG_to_local@8 +UserVARIANT_free_inst@4 +UserVARIANT_free_local@4 +UserVARIANT_from_local@8 +UserVARIANT_to_local@8 +VarDecFix@8 +VarDecInt@8 +VarDecNeg@8 +VarDecFromUI1@8 +VarDecFromI2@8 +VarDecFromI4@8 +VarDecFromR4@8 +VarDecFromR8@12 +VarDecFromDate@12 +VarDecFromCy@12 +VarDecFromStr@16 +VarDecFromDisp@12 +VarDecFromBool@8 +GetErrorInfo@8 +SetErrorInfo@8 +CreateErrorInfo@4 +VarDecRound@12 +VarDecCmp@8 +VarI2FromI1@8 +VarI2FromUI2@8 +VarI2FromUI4@8 +VarI2FromDec@8 +VarI4FromI1@8 +VarI4FromUI2@8 +VarI4FromUI4@8 +VarI4FromDec@8 +VarR4FromI1@8 +VarR4FromUI2@8 +VarR4FromUI4@8 +VarR4FromDec@8 +VarR8FromI1@8 +VarR8FromUI2@8 +VarR8FromUI4@8 +VarR8FromDec@8 +VarDateFromI1@8 +VarDateFromUI2@8 +VarDateFromUI4@8 +VarDateFromDec@8 +VarCyFromI1@8 +VarCyFromUI2@8 +VarCyFromUI4@8 +VarCyFromDec@8 +VarBstrFromI1@16 +VarBstrFromUI2@16 +VarBstrFromUI4@16 +VarBstrFromDec@16 +VarBoolFromI1@8 +VarBoolFromUI2@8 +VarBoolFromUI4@8 +VarBoolFromDec@8 +VarUI1FromI1@8 +VarUI1FromUI2@8 +VarUI1FromUI4@8 +VarUI1FromDec@8 +VarDecFromI1@8 +VarDecFromUI2@8 +VarDecFromUI4@8 +VarI1FromUI1@8 +VarI1FromI2@8 +VarI1FromI4@8 +VarI1FromR4@8 +VarI1FromR8@12 +VarI1FromDate@12 +VarI1FromCy@12 +VarI1FromStr@16 +VarI1FromDisp@12 +VarI1FromBool@8 +VarI1FromUI2@8 +VarI1FromUI4@8 +VarI1FromDec@8 +VarUI2FromUI1@8 +VarUI2FromI2@8 +VarUI2FromI4@8 +VarUI2FromR4@8 +VarUI2FromR8@12 +VarUI2FromDate@12 +VarUI2FromCy@12 +VarUI2FromStr@16 +VarUI2FromDisp@12 +VarUI2FromBool@8 +VarUI2FromI1@8 +VarUI2FromUI4@8 +VarUI2FromDec@8 +VarUI4FromUI1@8 +VarUI4FromI2@8 +VarUI4FromI4@8 +VarUI4FromR4@8 +VarUI4FromR8@12 +VarUI4FromDate@12 +VarUI4FromCy@12 +VarUI4FromStr@16 +VarUI4FromDisp@12 +VarUI4FromBool@8 +VarUI4FromI1@8 +VarUI4FromUI2@8 +VarUI4FromDec@8 +BSTR_UserSize@12 +BSTR_UserMarshal@12 +BSTR_UserUnmarshal@12 +BSTR_UserFree@8 +VARIANT_UserSize@12 +VARIANT_UserMarshal@12 +VARIANT_UserUnmarshal@12 +VARIANT_UserFree@8 +LPSAFEARRAY_UserSize@12 +LPSAFEARRAY_UserMarshal@12 +LPSAFEARRAY_UserUnmarshal@12 +LPSAFEARRAY_UserFree@8 +LPSAFEARRAY_Size@16 +LPSAFEARRAY_Marshal@16 +LPSAFEARRAY_Unmarshal@16 +VarDecCmpR8@12 +VarCyAdd@20 +DllUnregisterServer@0 +OACreateTypeLib2@12 +VarCyMul@20 +VarCyMulI4@16 +VarCySub@20 +VarCyAbs@12 +VarCyFix@12 +VarCyInt@12 +VarCyNeg@12 +VarCyRound@16 +VarCyCmp@16 +VarCyCmpR8@16 +VarBstrCat@12 +VarBstrCmp@16 +VarR8Pow@20 +VarR4CmpR8@12 +VarR8Round@16 +VarCat@12 +VarDateFromUdateEx@16 +GetRecordInfoFromGuids@24 +GetRecordInfoFromTypeInfo@8 +SetVarConversionLocaleSetting@4 +GetVarConversionLocaleSetting@4 +SetOaNoCache +VarCyMulI8@20 +VarDateFromUdate@12 +VarUdateFromDate@16 +GetAltMonthNames@8 +VarI8FromUI1@8 +VarI8FromI2@8 +VarI8FromR4@8 +VarI8FromR8@12 +VarI8FromCy@12 +VarI8FromDate@12 +VarI8FromStr@16 +VarI8FromDisp@12 +VarI8FromBool@8 +VarI8FromI1@8 +VarI8FromUI2@8 +VarI8FromUI4@8 +VarI8FromDec@8 +VarI2FromI8@12 +VarI2FromUI8@12 +VarI4FromI8@12 +VarI4FromUI8@12 +VarR4FromI8@12 +VarR4FromUI8@12 +VarR8FromI8@12 +VarR8FromUI8@12 +VarDateFromI8@12 +VarDateFromUI8@12 +VarCyFromI8@12 +VarCyFromUI8@12 +VarBstrFromI8@20 +VarBstrFromUI8@20 +VarBoolFromI8@12 +VarBoolFromUI8@12 +VarUI1FromI8@12 +VarUI1FromUI8@12 +VarDecFromI8@12 +VarDecFromUI8@12 +VarI1FromI8@12 +VarI1FromUI8@12 +VarUI2FromI8@12 +VarUI2FromUI8@12 +OleLoadPictureEx@32 +OleLoadPictureFileEx@32 +SafeArrayCreateVector@12 +SafeArrayCopyData@8 +VectorFromBstr@8 +BstrFromVector@8 +OleIconToCursor@8 +OleCreatePropertyFrameIndirect@4 +OleCreatePropertyFrame@44 +OleLoadPicture@20 +OleCreatePictureIndirect@16 +OleCreateFontIndirect@12 +OleTranslateColor@12 +OleLoadPictureFile@20 +OleSavePictureFile@8 +OleLoadPicturePath@24 +VarUI4FromI8@12 +VarUI4FromUI8@12 +VarI8FromUI8@12 +VarUI8FromI8@12 +VarUI8FromUI1@8 +VarUI8FromI2@8 +VarUI8FromR4@8 +VarUI8FromR8@12 +VarUI8FromCy@12 +VarUI8FromDate@12 +VarUI8FromStr@16 +VarUI8FromDisp@12 +VarUI8FromBool@8 +VarUI8FromI1@8 +VarUI8FromUI2@8 +VarUI8FromUI4@8 +VarUI8FromDec@8 +RegisterTypeLibForUser@12 +UnRegisterTypeLibForUser@20 +OaEnablePerUserTLibRegistration@0 +OACleanup@0 diff --git a/lib/libc/mingw/lib32/shell32.def b/lib/libc/mingw/lib32/shell32.def new file mode 100644 index 0000000000..7a366030fb --- /dev/null +++ b/lib/libc/mingw/lib32/shell32.def @@ -0,0 +1,356 @@ +; +; Definition file of SHELL32.dll +; Automatic generated by gendef +; written by Kai Tietz 2008 +; +LIBRARY "SHELL32.dll" +EXPORTS +SHChangeNotifyRegister@24 +SHDefExtractIconA@24 +SHChangeNotifyDeregister@4 +SHDefExtractIconW@24 +PifMgr_OpenProperties@16 +PifMgr_GetProperties@20 +PifMgr_SetProperties@20 +PifMgr_CloseProperties@8 +SHStartNetConnectionDialogW@12 +ILFindLastID@4 +ILRemoveLastID@4 +ILClone@4 +ILCloneFirst@4 +ILIsEqual@8 +DAD_DragEnterEx2@16 +ILIsParent@12 +ILFindChild@8 +ILCombine@8 +ILSaveToStream@8 +SHILCreateFromPath@12 +IsLFNDriveA@4 +IsLFNDriveW@4 +PathIsExe@4 +PathMakeUniqueName@20 +PathQualify@4 +PathResolve@12 +RestartDialog@12 +PickIconDlg@16 +GetFileNameFromBrowse@28 +DriveType@4 +IsNetDrive@4 +Shell_MergeMenus@24 +SHGetSetSettings@12 +Shell_GetImageLists@8 +Shell_GetCachedImageIndex@12 +SHShellFolderView_Message@12 +SHCreateStdEnumFmtEtc@12 +PathYetAnotherMakeUniqueName@16 +SHMapPIDLToSystemImageListIndex@12 +SHOpenPropSheetW@28 +OpenAs_RunDLL@16 +CIDLData_CreateFromIDArray@16 +OpenRegStream@16 +SHDoDragDrop@20 +SHCloneSpecialIDList@12 +SHFindFiles@8 +PathGetShortPath@4 +SHGetRealIDL@12 +SHRestricted@4 +SHCoCreateInstance@20 +SignalFileOpen@4 +IsLFNDrive@4 +OpenAs_RunDLLA@16 +DAD_AutoScroll@12 +DAD_DragEnterEx@12 +DAD_DragLeave@0 +OpenAs_RunDLLW@16 +DAD_DragMove@8 +PrepareDiscForBurnRunDllW@16 +DAD_SetDragImage@8 +DAD_ShowDragImage@4 +PrintersGetCommand_RunDLL@16 +PrintersGetCommand_RunDLLA@16 +SHCLSIDFromString@8 +SHFind_InitMenuPopup@16 +PrintersGetCommand_RunDLLW@16 +ILGetSize@4 +ILGetNext@4 +ILAppendID@12 +ILFree@4 +ILCreateFromPath@4 +SHSimpleIDListFromPath@4 +Win32DeleteFile@4 +SHCreateDirectory@8 +SHAddFromPropSheetExtArray@12 +SHCreatePropSheetExtArray@12 +SHDestroyPropSheetExtArray@4 +SHReplaceFromPropSheetExtArray@16 +PathCleanupSpec@8 +SHValidateUNC@12 +SHCreateShellFolderViewEx@8 +SHSetInstanceExplorer@4 +SHObjectProperties@16 +SHGetNewLinkInfoA@20 +SHGetNewLinkInfoW@20 +ShellMessageBoxW +ShellMessageBoxA +ILCreateFromPathA@4 +ILCreateFromPathW@4 +SHUpdateImageA@16 +SHUpdateImageW@16 +SHHandleUpdateImage@4 +SHFree@4 +SHAlloc@4 +SHHelpShortcuts_RunDLL@16 +SHHelpShortcuts_RunDLLA@16 +SHHelpShortcuts_RunDLLW@16 +AppCompat_RunDLLW@16 +AssocCreateForClasses@16 +AssocGetDetailsOfPropKey@20 +CheckEscapesW@8 +SHSetFolderPathA@16 +SHSetFolderPathW@16 +CommandLineToArgvW@8 +PathIsSlowW@8 +PathIsSlowA@8 +SHTestTokenMembership@8 +Control_RunDLL@16 +SHCreateShellFolderView@8 +Control_RunDLLA@16 +Control_RunDLLAsUserW@16 +Control_RunDLLW@16 +DllCanUnloadNow@0 +DllGetClassObject@12 +DllGetVersion@4 +DllInstall@8 +DllRegisterServer@0 +DllUnregisterServer@0 +DoEnvironmentSubstA@8 +DoEnvironmentSubstW@8 +DragAcceptFiles@8 +DragFinish@4 +DragQueryFile@16 +DragQueryFileA@16 +DragQueryFileAorW@24 +DragQueryFileW@16 +DragQueryPoint@8 +DuplicateIcon@8 +ExtractAssociatedIconA@12 +ExtractAssociatedIconExA@16 +ExtractAssociatedIconExW@16 +ExtractAssociatedIconW@12 +ExtractIconA@12 +ExtractIconEx@20 +ExtractIconExA@20 +ExtractIconExW@20 +ExtractIconW@12 +FindExecutableA@12 +FindExecutableW@12 +FreeIconList@8 +GetCurrentProcessExplicitAppUserModelID@4 +InitNetworkAddressControl@0 +InternalExtractIconListA@12 +InternalExtractIconListW@12 +LaunchMSHelp_RunDLLW@16 +Options_RunDLL@16 +Options_RunDLLA@16 +Options_RunDLLW@16 +RealShellExecuteA@40 +RealShellExecuteExA@44 +RealShellExecuteExW@44 +RealShellExecuteW@40 +RegenerateUserEnvironment@8 +RunAsNewUser_RunDLLW@16 +SHAddDefaultPropertiesByExt@8 +SHAddToRecentDocs@8 +SHAppBarMessage@8 +SHAssocEnumHandlers@12 +SHAssocEnumHandlersForProtocolByApplication@12 +SHBindToFolderIDListParent@20 +SHBindToFolderIDListParentEx@24 +SHBindToObject@20 +SHBindToParent@16 +SHBrowseForFolder@4 +SHBrowseForFolderA@4 +SHBrowseForFolderW@4 +SHChangeNotify@16 +SHChangeNotifyRegisterThread@4 +SHChangeNotifySuspendResume@16 +SHCreateAssociationRegistration@8 +SHCreateDataObject@24 +SHCreateDefaultContextMenu@12 +SHCreateDefaultExtractIcon@8 +SHCreateDefaultPropertiesOp@8 +SHCreateDirectoryExA@12 +SHCreateDirectoryExW@12 +SHCreateItemFromIDList@12 +SHCreateItemFromParsingName@16 +SHCreateItemFromRelativeName@20 +SHCreateItemInKnownFolder@20 +SHCreateItemWithParent@20 +SHCreateLocalServerRunDll@16 +SHCreateProcessAsUserW@4 +SHCreateQueryCancelAutoPlayMoniker@4 +SHCreateShellItem@16 +SHCreateShellItemArray@20 +SHCreateShellItemArrayFromDataObject@12 +SHCreateShellItemArrayFromIDLists@12 +SHCreateShellItemArrayFromShellItem@12 +SHEmptyRecycleBinA@12 +SHEmptyRecycleBinW@12 +SHEnableServiceObject@8 +SHEnumerateUnreadMailAccountsW@16 +SHEvaluateSystemCommandTemplate@16 +SHExtractIconsW@32 +SHFileOperation@4 +SHFileOperationA@4 +SHFileOperationW@4 +SHFormatDrive@16 +SHFreeNameMappings@4 +SHGetDataFromIDListA@20 +SHGetDataFromIDListW@20 +SHGetDesktopFolder@4 +SHGetDiskFreeSpaceA@16 +SHGetDiskFreeSpaceExA@16 +SHGetDiskFreeSpaceExW@16 +SHGetDriveMedia@8 +SHGetFileInfo@20 +SHGetFileInfoA@20 +SHGetFileInfoW@20 +SHGetFolderLocation@20 +SHGetFolderPathA@20 +SHGetFolderPathAndSubDirA@24 +SHGetFolderPathAndSubDirW@24 +SHGetFolderPathEx@20 +SHGetFolderPathW@20 +SheShortenPathW@8 +SheShortenPathA@8 +SHGetIDListFromObject@8 +SHGetIconOverlayIndexA@8 +SHGetIconOverlayIndexW@8 +SHGetInstanceExplorer@4 +SHGetItemFromDataObject@16 +SHGetItemFromObject@12 +SHGetKnownFolderIDList@16 +SHGetKnownFolderItem@20 +SHGetKnownFolderPath@16 +SHGetLocalizedName@16 +SHGetMalloc@4 +SHGetNameFromIDList@12 +SHGetNewLinkInfo@20 +SHGetPathFromIDList@8 +SHGetPathFromIDListA@8 +SHGetPathFromIDListEx@16 +SHGetPathFromIDListW@8 +SHGetPropertyStoreForWindow@12 +SHGetPropertyStoreFromIDList@16 +SHGetPropertyStoreFromParsingName@20 +SHGetSettings@8 +SHGetSpecialFolderLocation@12 +SHGetSpecialFolderPathA@16 +SHGetSpecialFolderPathW@16 +SHGetStockIconInfo@12 +SHGetTemporaryPropertyForItem@12 +SHGetUnreadMailCountW@24 +SHInvokePrinterCommandA@20 +SHInvokePrinterCommandW@20 +SHIsFileAvailableOffline@8 +SHLoadInProc@4 +SHLoadNonloadedIconOverlayIdentifiers@0 +SHOpenFolderAndSelectItems@16 +SHOpenWithDialog@8 +SHParseDisplayName@20 +SHPathPrepareForWriteA@16 +SHPathPrepareForWriteW@16 +SHQueryRecycleBinA@8 +SHQueryRecycleBinW@8 +SHQueryUserNotificationState@4 +SHRemoveLocalizedName@4 +SHResolveLibrary@4 +SHSetDefaultProperties@16 +SHSetKnownFolderPath@16 +SHSetLocalizedName@12 +SHSetTemporaryPropertyForItem@12 +SHSetUnreadMailCountW@12 +SHShowManageLibraryUI@20 +SHUpdateRecycleBinIcon@0 +SetCurrentProcessExplicitAppUserModelID@4 +SheChangeDirA@4 +SheChangeDirExW@4 +SheChangeDirExA@4 +SheGetDirA@8 +SheSetCurDrive@4 +SheRemoveQuotesW@4 +SheRemoveQuotesA@4 +ShellAboutA@16 +ShellAboutW@16 +ShellExec_RunDLL@16 +ShellExec_RunDLLA@16 +ShellExec_RunDLLW@16 +ShellExecuteA@24 +ShellExecuteEx@4 +ShellExecuteExA@4 +ShellExecuteExW@4 +ShellExecuteW@24 +ShellHookProc@12 +Shell_GetCachedImageIndexA@12 +Shell_GetCachedImageIndexW@12 +Shell_NotifyIcon@8 +Shell_NotifyIconA@8 +Shell_NotifyIconGetRect@8 +Shell_NotifyIconW@8 +SheGetPathOffsetW@4 +SheGetCurDrive@0 +SheGetDirW@8 +SheFullPathW@12 +SheFullPathA@12 +SheConvertPathW@12 +SheChangeDirW@4 +ExtractIconW@ +ExtractIconResInfoW@20 +ExtractIconResInfoA@20 +SheGetDirExW@12 +StrChrA@8 +StrChrIA@8 +StrChrIW@8 +StrChrW@8 +StrCmpNA@12 +StrCmpNIA@12 +StrCmpNIW@12 +StrCmpNW@12 +StrNCmpA@12 +StrNCmpIA@12 +StrNCmpIW@12 +StrNCmpW@12 +StrRChrA@12 +StrRChrIA@12 +StrRChrIW@12 +StrRChrW@12 +StrRStrA@12 +StrRStrIA@12 +StrRStrIW@12 +StrRStrW@12 +StrStrA@8 +StrStrIA@8 +StrStrIW@8 +StrStrW@8 +WOWShellExecute@28 +WaitForExplorerRestartW@16 +RealDriveType@8 +SHFlushSFCache@0 +SHChangeNotification_Lock@16 +SHChangeNotification_Unlock@4 +WriteCabinetState@4 +ReadCabinetState@8 +IsUserAnAdmin@0 +StgMakeUniqueName@20 +SHPropStgCreate@32 +SHPropStgReadMultiple@20 +SHPropStgWriteMultiple@24 +CDefFolderMenu_Create2@36 +SHGetSetFolderCustomSettings@12 +SHMultiFileProperties@8 +SHGetImageList@12 +RestartDialogEx@16 +SHCreateFileExtractIconW@16 +SHLimitInputEdit@8 +SHGetAttributesFromDataObject@16 +ILLoadFromStreamEx@8 diff --git a/lib/libc/mingw/lib32/winmm.def b/lib/libc/mingw/lib32/winmm.def new file mode 100644 index 0000000000..4de3638e5d --- /dev/null +++ b/lib/libc/mingw/lib32/winmm.def @@ -0,0 +1,196 @@ +LIBRARY WINMM.DLL +EXPORTS +CloseDriver@12 +DefDriverProc@20 +DriverCallback@28 +DrvGetModuleHandle@4 +GetDriverModuleHandle@4 +NotifyCallbackData@20 +OpenDriver@12 +PlaySound@12 +PlaySoundA@12 +PlaySoundW@12 +SendDriverMessage@16 +WOW32DriverCallback@28 +WOW32ResolveMultiMediaHandle@24 +WOWAppExit@4 +aux32Message@20 +auxGetDevCapsA@12 +auxGetDevCapsW@12 +auxGetNumDevs@0 +auxGetVolume@8 +auxOutMessage@16 +auxSetVolume@8 +joy32Message@20 +joyConfigChanged@4 +joyGetDevCapsA@12 +joyGetDevCapsW@12 +joyGetNumDevs@0 +joyGetPos@8 +joyGetPosEx@8 +joyGetThreshold@8 +joyReleaseCapture@4 +joySetCapture@16 +joySetThreshold@8 +mci32Message@20 +mciDriverNotify@12 +mciDriverYield@4 +mciExecute@4 +mciFreeCommandResource@4 +mciGetCreatorTask@4 +mciGetDeviceIDA@4 +mciGetDeviceIDFromElementIDA@8 +mciGetDeviceIDFromElementIDW@8 +mciGetDeviceIDW@4 +mciGetDriverData@4 +mciGetErrorStringA@12 +mciGetErrorStringW@12 +mciGetYieldProc@8 +mciLoadCommandResource@12 +mciSendCommandA@16 +mciSendCommandW@16 +mciSendStringA@16 +mciSendStringW@16 +mciSetDriverData@8 +mciSetYieldProc@12 +mid32Message@20 +midiConnect@12 +midiDisconnect@12 +midiInAddBuffer@12 +midiInClose@4 +midiInGetDevCapsA@12 +midiInGetDevCapsW@12 +midiInGetErrorTextA@12 +midiInGetErrorTextW@12 +midiInGetID@8 +midiInGetNumDevs@0 +midiInMessage@16 +midiInOpen@20 +midiInPrepareHeader@12 +midiInReset@4 +midiInStart@4 +midiInStop@4 +midiInUnprepareHeader@12 +midiOutCacheDrumPatches@16 +midiOutCachePatches@16 +midiOutClose@4 +midiOutGetDevCapsA@12 +midiOutGetDevCapsW@12 +midiOutGetErrorTextA@12 +midiOutGetErrorTextW@12 +midiOutGetID@8 +midiOutGetNumDevs@0 +midiOutGetVolume@8 +midiOutLongMsg@12 +midiOutMessage@16 +midiOutOpen@20 +midiOutPrepareHeader@12 +midiOutReset@4 +midiOutSetVolume@8 +midiOutShortMsg@8 +midiOutUnprepareHeader@12 +midiStreamClose@4 +midiStreamOpen@24 +midiStreamOut@12 +midiStreamPause@4 +midiStreamPosition@12 +midiStreamProperty@12 +midiStreamRestart@4 +midiStreamStop@4 +mixerClose@4 +mixerGetControlDetailsA@12 +mixerGetControlDetailsW@12 +mixerGetDevCapsA@12 +mixerGetDevCapsW@12 +mixerGetID@12 +mixerGetLineControlsA@12 +mixerGetLineControlsW@12 +mixerGetLineInfoA@12 +mixerGetLineInfoW@12 +mixerGetNumDevs@0 +mixerMessage@16 +mixerOpen@20 +mixerSetControlDetails@12 +mmDrvInstall@12 +mmGetCurrentTask@0 +mmTaskBlock@4 +mmTaskCreate@12 +mmTaskSignal@4 +mmTaskYield@0 +mmioAdvance@12 +mmioAscend@12 +mmioClose@8 +mmioCreateChunk@12 +mmioDescend@16 +mmioFlush@8 +mmioGetInfo@12 +mmioInstallIOProcA@12 +mmioInstallIOProcW@12 +mmioOpenA@12 +mmioOpenW@12 +mmioRead@12 +mmioRenameA@16 +mmioRenameW@16 +mmioSeek@12 +mmioSendMessage@16 +mmioSetBuffer@16 +mmioSetInfo@12 +mmioStringToFOURCCA@8 +mmioStringToFOURCCW@8 +mmioWrite@12 +mmsystemGetVersion@0 +mod32Message@20 +mxd32Message@20 +sndPlaySoundA@8 +sndPlaySoundW@8 +tid32Message@20 +timeBeginPeriod@4 +timeEndPeriod@4 +timeGetDevCaps@8 +timeGetSystemTime@8 +timeGetTime@0 +timeKillEvent@4 +timeSetEvent@20 +waveInAddBuffer@12 +waveInClose@4 +waveInGetDevCapsA@12 +waveInGetDevCapsW@12 +waveInGetErrorTextA@12 +waveInGetErrorTextW@12 +waveInGetID@8 +waveInGetNumDevs@0 +waveInGetPosition@12 +waveInMessage@16 +waveInOpen@24 +waveInPrepareHeader@12 +waveInReset@4 +waveInStart@4 +waveInStop@4 +waveInUnprepareHeader@12 +waveOutBreakLoop@4 +waveOutClose@4 +waveOutGetDevCapsA@12 +waveOutGetDevCapsW@12 +waveOutGetErrorTextA@12 +waveOutGetErrorTextW@12 +waveOutGetID@8 +waveOutGetNumDevs@0 +waveOutGetPitch@8 +waveOutGetPlaybackRate@8 +waveOutGetPosition@12 +waveOutGetVolume@8 +waveOutMessage@16 +waveOutOpen@24 +waveOutPause@4 +waveOutPrepareHeader@12 +waveOutReset@4 +waveOutRestart@4 +waveOutSetPitch@8 +waveOutSetPlaybackRate@8 +waveOutSetVolume@8 +waveOutUnprepareHeader@12 +waveOutWrite@12 +wid32Message@20 +winmmDbgOut +winmmSetDebugLevel@4 +wod32Message@20 From 86e5bbffd757c211c062acef6c244ec94f5db668 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 9 Oct 2019 22:41:38 +0200 Subject: [PATCH 06/41] Patch lld to have a more sensible kill-at implementation Lift some code from llvm-dlltool, the lld code is meant to follow what gnu ld does but that's not much useful for our purposes. Also use the `--kill-at` option when generating the .lib files out of mingw's .def files: this way our building process closely matches the one use by the upstream and now finally generates files that allow both C code and Zig code to link. --- deps/lld/COFF/DriverUtils.cpp | 16 ++++++++++++---- src/link.cpp | 9 +++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/deps/lld/COFF/DriverUtils.cpp b/deps/lld/COFF/DriverUtils.cpp index 4360ac23b2..5003a99da4 100644 --- a/deps/lld/COFF/DriverUtils.cpp +++ b/deps/lld/COFF/DriverUtils.cpp @@ -638,10 +638,18 @@ void fixupExports() { if (config->killAt && config->machine == I386) { for (Export &e : config->exports) { - e.name = killAt(e.name, true); - e.exportName = killAt(e.exportName, false); - e.extName = killAt(e.extName, true); - e.symbolName = killAt(e.symbolName, true); + if (!e.name.empty() && e.name[0] == '?') + continue; + e.symbolName = e.name; + // Trim off the trailing decoration. Symbols will always have a + // starting prefix here (either _ for cdecl/stdcall, @ for fastcall + // or ? for C++ functions). Vectorcall functions won't have any + // fixed prefix, but the function base name will still be at least + // one char. + e.name = e.name.substr(0, e.name.find('@', 1)); + // By making sure E.SymbolName != E.Name for decorated symbols, + // writeImportLibrary writes these symbols with the type + // IMPORT_NAME_UNDECORATE. } } diff --git a/src/link.cpp b/src/link.cpp index 1310210cba..f7ae4a8400 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -2057,10 +2057,19 @@ static const char *get_def_lib(CodeGen *parent, const char *name, Buf *def_in_fi args.resize(0); args.append("link"); coff_append_machine_arg(parent, &args); + args.append("-lldmingw"); + args.append("-kill-at"); args.append(buf_ptr(buf_sprintf("-DEF:%s", buf_ptr(def_final_path)))); args.append(buf_ptr(buf_sprintf("-OUT:%s", buf_ptr(lib_final_path)))); + if (parent->verbose_link) { + for (size_t i = 0; i < args.length; i += 1) { + fprintf(stderr, "%s ", args.at(i)); + } + fprintf(stderr, "\n"); + } + Buf diag = BUF_INIT; ZigLLVM_ObjectFormatType target_ofmt = target_object_format(parent->zig_target); if (!zig_lld_link(target_ofmt, args.items, args.length, &diag)) { From dfcbca8d2fed33c1fbd47b0b4e98ed0c214fa7e6 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 9 Oct 2019 22:49:33 +0200 Subject: [PATCH 07/41] Add i386/mingw to the test rooster --- test/tests.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/tests.zig b/test/tests.zig index 3c6baeb360..66af44da47 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -173,6 +173,17 @@ const test_targets = [_]TestTarget{ }, }, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .windows, + .arch = .i386, + .abi = .gnu, + }, + }, + .link_libc = true, + }, + TestTarget{ .target = Target{ .Cross = CrossTarget{ From 4de3f9d8537fb32017265a2228f9799481db11a0 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 10 Oct 2019 09:25:39 +0200 Subject: [PATCH 08/41] Fix stack-probe symbol redefinition --- lib/std/special/compiler_rt.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig index 88e3078d6a..0a09f616e9 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -238,7 +238,8 @@ comptime { if (is_mingw) { @export("_alloca", @import("compiler_rt/stack_probe.zig")._chkstk, strong_linkage); @export("___chkstk_ms", @import("compiler_rt/stack_probe.zig").___chkstk_ms, strong_linkage); - } else { + } else if (!builtin.link_libc) { + // This symbols are otherwise exported by MSVCRT.lib @export("_chkstk", @import("compiler_rt/stack_probe.zig")._chkstk, strong_linkage); @export("__chkstk", @import("compiler_rt/stack_probe.zig").__chkstk, strong_linkage); } From 7b20205e689de78aea624639c356a10aff26b75b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 10 Oct 2019 21:24:44 -0400 Subject: [PATCH 09/41] codegen.cpp: remove unused variable --- src/codegen.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index 055a66792e..e2e117d27a 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -413,7 +413,6 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) { linkage = fn_export->linkage; } - bool external_linkage = linkage != GlobalLinkageIdInternal; CallingConvention cc = fn->type_entry->data.fn.fn_type_id.cc; bool is_async = fn_is_async(fn); From 01b2c291d55e9f1b02c877537ba2b1b48079bb8b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 10 Oct 2019 23:22:18 -0400 Subject: [PATCH 10/41] miscellaneous improvements to generated docs * introduce std.json.WriteStream API for writing json data to a stream * add WIP tools/merge_anal_dumps.zig for merging multiple semantic analysis dumps into one. See #3028 * add std.json.Array, improves generated docs * add test for `std.process.argsAlloc`, improves test coverage and generated docs --- lib/std/io.zig | 2 +- lib/std/json.zig | 62 +++++++++- lib/std/json/write_stream.zig | 211 ++++++++++++++++++++++++++++++++++ lib/std/os/test.zig | 5 + tools/merge_anal_dumps.zig | 107 +++++++++++++++++ 5 files changed, 380 insertions(+), 7 deletions(-) create mode 100644 lib/std/json/write_stream.zig create mode 100644 tools/merge_anal_dumps.zig diff --git a/lib/std/io.zig b/lib/std/io.zig index 09844bf055..2c9c97131b 100644 --- a/lib/std/io.zig +++ b/lib/std/io.zig @@ -508,7 +508,7 @@ pub fn BitInStream(endian: builtin.Endian, comptime Error: type) type { }; } -/// This is a simple OutStream that writes to a slice, and returns an error +/// This is a simple OutStream that writes to a fixed buffer, and returns an error /// when it runs out of space. pub const SliceOutStream = struct { pub const Error = error{OutOfSpace}; diff --git a/lib/std/json.zig b/lib/std/json.zig index f562a672f8..07916ff842 100644 --- a/lib/std/json.zig +++ b/lib/std/json.zig @@ -8,6 +8,8 @@ const testing = std.testing; const mem = std.mem; const maxInt = std.math.maxInt; +pub const WriteStream = @import("json/write_stream.zig").WriteStream; + // A single token slice into the parent string. // // Use `token.slice()` on the input at the current position to get the current slice. @@ -1001,6 +1003,7 @@ pub const ValueTree = struct { }; pub const ObjectMap = StringHashMap(Value); +pub const Array = ArrayList(Value); pub const Value = union(enum) { Null, @@ -1008,7 +1011,7 @@ pub const Value = union(enum) { Integer: i64, Float: f64, String: []const u8, - Array: ArrayList(Value), + Array: Array, Object: ObjectMap, pub fn dump(self: Value) void { @@ -1134,7 +1137,7 @@ pub const Parser = struct { state: State, copy_strings: bool, // Stores parent nodes and un-combined Values. - stack: ArrayList(Value), + stack: Array, const State = enum { ObjectKey, @@ -1148,7 +1151,7 @@ pub const Parser = struct { .allocator = allocator, .state = State.Simple, .copy_strings = copy_strings, - .stack = ArrayList(Value).init(allocator), + .stack = Array.init(allocator), }; } @@ -1210,7 +1213,7 @@ pub const Parser = struct { p.state = State.ObjectKey; }, Token.Id.ArrayBegin => { - try p.stack.append(Value{ .Array = ArrayList(Value).init(allocator) }); + try p.stack.append(Value{ .Array = Array.init(allocator) }); p.state = State.ArrayValue; }, Token.Id.String => { @@ -1260,7 +1263,7 @@ pub const Parser = struct { p.state = State.ObjectKey; }, Token.Id.ArrayBegin => { - try p.stack.append(Value{ .Array = ArrayList(Value).init(allocator) }); + try p.stack.append(Value{ .Array = Array.init(allocator) }); p.state = State.ArrayValue; }, Token.Id.String => { @@ -1289,7 +1292,7 @@ pub const Parser = struct { p.state = State.ObjectKey; }, Token.Id.ArrayBegin => { - try p.stack.append(Value{ .Array = ArrayList(Value).init(allocator) }); + try p.stack.append(Value{ .Array = Array.init(allocator) }); p.state = State.ArrayValue; }, Token.Id.String => { @@ -1405,3 +1408,50 @@ test "json.parser.dynamic" { test "import more json tests" { _ = @import("json/test.zig"); } + +test "write json then parse it" { + var out_buffer: [1000]u8 = undefined; + + var slice_out_stream = std.io.SliceOutStream.init(&out_buffer); + const out_stream = &slice_out_stream.stream; + var jw = WriteStream(@typeOf(out_stream).Child, 4).init(out_stream); + + try jw.beginObject(); + + try jw.objectField("f"); + try jw.emitBool(false); + + try jw.objectField("t"); + try jw.emitBool(true); + + try jw.objectField("int"); + try jw.emitNumber(i32(1234)); + + try jw.objectField("array"); + try jw.beginArray(); + + try jw.arrayElem(); + try jw.emitNull(); + + try jw.arrayElem(); + try jw.emitNumber(f64(12.34)); + + try jw.endArray(); + + try jw.objectField("str"); + try jw.emitString("hello"); + + try jw.endObject(); + + var mem_buffer: [1024 * 20]u8 = undefined; + const allocator = &std.heap.FixedBufferAllocator.init(&mem_buffer).allocator; + var parser = Parser.init(allocator, false); + const tree = try parser.parse(slice_out_stream.getWritten()); + + testing.expect(tree.root.Object.get("f").?.value.Bool == false); + testing.expect(tree.root.Object.get("t").?.value.Bool == true); + testing.expect(tree.root.Object.get("int").?.value.Integer == 1234); + testing.expect(tree.root.Object.get("array").?.value.Array.at(0).Null == {}); + testing.expect(tree.root.Object.get("array").?.value.Array.at(1).Float == 12.34); + testing.expect(mem.eql(u8, tree.root.Object.get("str").?.value.String, "hello")); +} diff --git a/lib/std/json/write_stream.zig b/lib/std/json/write_stream.zig new file mode 100644 index 0000000000..2bb79a017c --- /dev/null +++ b/lib/std/json/write_stream.zig @@ -0,0 +1,211 @@ +const std = @import("../std.zig"); +const assert = std.debug.assert; +const maxInt = std.math.maxInt; + +const State = enum { + Complete, + Value, + ArrayStart, + Array, + ObjectStart, + Object, +}; + +/// Writes JSON ([RFC8259](https://tools.ietf.org/html/rfc8259)) formatted data +/// to a stream. `max_depth` is a comptime-known upper bound on the nesting depth. +/// TODO A future iteration of this API will allow passing `null` for this value, +/// and disable safety checks in release builds. +pub fn WriteStream(comptime OutStream: type, comptime max_depth: usize) type { + return struct { + const Self = @This(); + + pub const Stream = OutStream; + + /// The string used for indenting. + one_indent: []const u8 = " ", + + /// The string used as a newline character. + newline: []const u8 = "\n", + + stream: *OutStream, + state_index: usize, + state: [max_depth]State, + + pub fn init(stream: *OutStream) Self { + var self = Self{ + .stream = stream, + .state_index = 1, + .state = undefined, + }; + self.state[0] = .Complete; + self.state[1] = .Value; + return self; + } + + pub fn beginArray(self: *Self) !void { + assert(self.state[self.state_index] == State.Value); // need to call arrayElem or objectField + try self.stream.writeByte('['); + self.state[self.state_index] = State.ArrayStart; + } + + pub fn beginObject(self: *Self) !void { + assert(self.state[self.state_index] == State.Value); // need to call arrayElem or objectField + try self.stream.writeByte('{'); + self.state[self.state_index] = State.ObjectStart; + } + + pub fn arrayElem(self: *Self) !void { + const state = self.state[self.state_index]; + switch (state) { + .Complete => unreachable, + .Value => unreachable, + .ObjectStart => unreachable, + .Object => unreachable, + .Array, .ArrayStart => { + if (state == .Array) { + try self.stream.writeByte(','); + } + self.state[self.state_index] = .Array; + self.pushState(.Value); + try self.indent(); + }, + } + } + + pub fn objectField(self: *Self, name: []const u8) !void { + const state = self.state[self.state_index]; + switch (state) { + .Complete => unreachable, + .Value => unreachable, + .ArrayStart => unreachable, + .Array => unreachable, + .Object, .ObjectStart => { + if (state == .Object) { + try self.stream.writeByte(','); + } + self.state[self.state_index] = .Object; + self.pushState(.Value); + try self.indent(); + try self.writeEscapedString(name); + try self.stream.write(": "); + }, + } + } + + pub fn endArray(self: *Self) !void { + switch (self.state[self.state_index]) { + .Complete => unreachable, + .Value => unreachable, + .ObjectStart => unreachable, + .Object => unreachable, + .ArrayStart => { + try self.stream.writeByte(']'); + self.popState(); + }, + .Array => { + try self.indent(); + self.popState(); + try self.stream.writeByte(']'); + }, + } + } + + pub fn endObject(self: *Self) !void { + switch (self.state[self.state_index]) { + .Complete => unreachable, + .Value => unreachable, + .ArrayStart => unreachable, + .Array => unreachable, + .ObjectStart => { + try self.stream.writeByte('}'); + self.popState(); + }, + .Object => { + try self.indent(); + self.popState(); + try self.stream.writeByte('}'); + }, + } + } + + pub fn emitNull(self: *Self) !void { + assert(self.state[self.state_index] == State.Value); + try self.stream.write("null"); + self.popState(); + } + + pub fn emitBool(self: *Self, value: bool) !void { + assert(self.state[self.state_index] == State.Value); + if (value) { + try self.stream.write("true"); + } else { + try self.stream.write("false"); + } + self.popState(); + } + + pub fn emitNumber( + self: *Self, + /// An integer, float, or `std.math.BigInt`. Emitted as a bare number if it fits losslessly + /// in a IEEE 754 double float, otherwise emitted as a string to the full precision. + value: var, + ) !void { + assert(self.state[self.state_index] == State.Value); + switch (@typeInfo(@typeOf(value))) { + .Int => |info| if (info.bits < 53 or (value < 4503599627370496 and value > -4503599627370496)) { + try self.stream.print("{}", value); + self.popState(); + return; + }, + .Float => if (@floatCast(f64, value) == value) { + try self.stream.print("{}", value); + self.popState(); + return; + }, + else => {}, + } + try self.stream.print("\"{}\"", value); + self.popState(); + } + + pub fn emitString(self: *Self, string: []const u8) !void { + try self.writeEscapedString(string); + self.popState(); + } + + fn writeEscapedString(self: *Self, string: []const u8) !void { + try self.stream.writeByte('"'); + for (string) |s| { + switch (s) { + '"' => try self.stream.write("\\\""), + '\t' => try self.stream.write("\\t"), + '\r' => try self.stream.write("\\r"), + '\n' => try self.stream.write("\\n"), + 8 => try self.stream.write("\\b"), + 12 => try self.stream.write("\\f"), + '\\' => try self.stream.write("\\\\"), + else => try self.stream.writeByte(s), + } + } + try self.stream.writeByte('"'); + } + + fn indent(self: *Self) !void { + assert(self.state_index >= 1); + try self.stream.write(self.newline); + var i: usize = 0; + while (i < self.state_index - 1) : (i += 1) { + try self.stream.write(self.one_indent); + } + } + + fn pushState(self: *Self, state: State) void { + self.state_index += 1; + self.state[self.state_index] = state; + } + + fn popState(self: *Self) void { + self.state_index -= 1; + } + }; +} diff --git a/lib/std/os/test.zig b/lib/std/os/test.zig index 4ca843cf68..8d6b437ff3 100644 --- a/lib/std/os/test.zig +++ b/lib/std/os/test.zig @@ -232,3 +232,8 @@ test "pipe" { os.close(fds[1]); os.close(fds[0]); } + +test "argsAlloc" { + var args = try std.process.argsAlloc(std.heap.direct_allocator); + std.heap.direct_allocator.free(args); +} diff --git a/tools/merge_anal_dumps.zig b/tools/merge_anal_dumps.zig new file mode 100644 index 0000000000..65b21766f4 --- /dev/null +++ b/tools/merge_anal_dumps.zig @@ -0,0 +1,107 @@ +const builtin = @import("builtin"); +const std = @import("std"); +const json = std.json; +const mem = std.mem; + +pub fn main() anyerror!void { + var arena = std.heap.ArenaAllocator.init(std.heap.direct_allocator); + defer arena.deinit(); + + const allocator = &arena.allocator; + + const args = try std.process.argsAlloc(allocator); + + var parser: json.Parser = undefined; + var dump = Dump.init(allocator); + for (args[1..]) |arg| { + parser = json.Parser.init(allocator, false); + const json_text = try std.io.readFileAlloc(allocator, arg); + const tree = try parser.parse(json_text); + try dump.mergeJson(tree.root); + } + + const stdout = try std.io.getStdOut(); + try dump.render(&stdout.outStream().stream); +} + +const Dump = struct { + zig_id: ?[]const u8 = null, + zig_version: ?[]const u8 = null, + root_name: ?[]const u8 = null, + targets: std.ArrayList([]const u8), + files_list: std.ArrayList([]const u8), + files_map: std.StringHashMap(usize), + + fn init(allocator: *mem.Allocator) Dump { + return Dump{ + .targets = std.ArrayList([]const u8).init(allocator), + .files_list = std.ArrayList([]const u8).init(allocator), + .files_map = std.StringHashMap(usize).init(allocator), + }; + } + + fn mergeJson(self: *Dump, root: json.Value) !void { + const params = &root.Object.get("params").?.value.Object; + const zig_id = params.get("zigId").?.value.String; + const zig_version = params.get("zigVersion").?.value.String; + const root_name = params.get("rootName").?.value.String; + try mergeSameStrings(&self.zig_id, zig_id); + try mergeSameStrings(&self.zig_version, zig_version); + try mergeSameStrings(&self.root_name, root_name); + + const target = params.get("target").?.value.String; + try self.targets.append(target); + + // Merge files + const other_files = root.Object.get("files").?.value.Array.toSliceConst(); + var other_file_to_mine = std.AutoHashMap(usize, usize).init(self.a()); + for (other_files) |other_file, i| { + const gop = try self.files_map.getOrPut(other_file.String); + if (gop.found_existing) { + try other_file_to_mine.putNoClobber(i, gop.kv.value); + } else { + gop.kv.value = self.files_list.len; + try self.files_list.append(other_file.String); + } + } + + const other_ast_nodes = root.Object.get("astNodes").?.value.Array.toSliceConst(); + var other_ast_node_to_mine = std.AutoHashMap(usize, usize).init(self.a()); + } + + fn render(self: *Dump, stream: var) !void { + var jw = json.WriteStream(@typeOf(stream).Child, 10).init(stream); + try jw.beginObject(); + + try jw.objectField("typeKinds"); + try jw.beginArray(); + inline for (@typeInfo(builtin.TypeId).Enum.fields) |field| { + try jw.arrayElem(); + try jw.emitString(field.name); + } + try jw.endArray(); + + try jw.objectField("files"); + try jw.beginArray(); + for (self.files_list.toSliceConst()) |file| { + try jw.arrayElem(); + try jw.emitString(file); + } + try jw.endArray(); + + try jw.endObject(); + } + + fn a(self: Dump) *mem.Allocator { + return self.targets.allocator; + } + + fn mergeSameStrings(opt_dest: *?[]const u8, src: []const u8) !void { + if (opt_dest.*) |dest| { + if (!mem.eql(u8, dest, src)) + return error.MismatchedDumps; + } else { + opt_dest.* = src; + } + } +}; From 8aa20227ed45294da9606222d0b20eb922cecb2e Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Fri, 11 Oct 2019 19:13:59 +0200 Subject: [PATCH 11/41] Fix cross-compilation to i386-windows-msvc Use Mingw's .def files to build a .lib when possible and show an error otherwise. --- src/link.cpp | 150 +++++++++++++++++++++++++------------------------ test/tests.zig | 10 ++++ 2 files changed, 88 insertions(+), 72 deletions(-) diff --git a/src/link.cpp b/src/link.cpp index f7ae4a8400..de35a18f33 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -2098,6 +2098,60 @@ static bool is_linking_system_lib(CodeGen *g, const char *name) { return false; } +static Error find_mingw_lib_def(LinkJob *lj, const char *name, Buf *out_path) { + CodeGen *g = lj->codegen; + Buf override_path = BUF_INIT; + Error err; + + char const *lib_path = nullptr; + if (g->zig_target->arch == ZigLLVM_x86) { + lib_path = "lib32"; + } else if (g->zig_target->arch == ZigLLVM_x86_64) { + lib_path = "lib64"; + } else if (target_is_arm(g->zig_target)) { + const bool is_32 = target_arch_pointer_bit_width(g->zig_target->arch) == 32; + lib_path = is_32 ? "libarm32" : "libarm64"; + } else { + zig_unreachable(); + } + + // Try the archtecture-specific path first + buf_resize(&override_path, 0); + buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "%s" OS_SEP "%s.def", buf_ptr(g->zig_lib_dir), lib_path, name); + + bool does_exist; + if ((err = os_file_exists(&override_path, &does_exist)) != ErrorNone) { + return err; + } + + if (!does_exist) { + // Try the generic version + buf_resize(&override_path, 0); + buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "lib-common" OS_SEP "%s.def", buf_ptr(g->zig_lib_dir), name); + + if ((err = os_file_exists(&override_path, &does_exist)) != ErrorNone) { + return err; + } + } + + if (!does_exist) { + // Try the generic version and preprocess it + buf_resize(&override_path, 0); + buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "lib-common" OS_SEP "%s.def.in", buf_ptr(g->zig_lib_dir), name); + + if ((err = os_file_exists(&override_path, &does_exist)) != ErrorNone) { + return err; + } + } + + if (!does_exist) { + return ErrorFileNotFound; + } + + buf_init_from_buf(out_path, &override_path); + return ErrorNone; +} + static void add_mingw_link_args(LinkJob *lj, bool is_library) { CodeGen *g = lj->codegen; @@ -2125,55 +2179,18 @@ static void add_mingw_link_args(LinkJob *lj, bool is_library) { const char *name = mingw_def_list[def_i].name; const bool always_link = mingw_def_list[def_i].always_link; - Buf override_path = BUF_INIT; + Buf lib_path = BUF_INIT; + Error err = find_mingw_lib_def(lj, name, &lib_path); - char const *lib_path = nullptr; - if (g->zig_target->arch == ZigLLVM_x86) { - lib_path = "lib32"; - } else if (g->zig_target->arch == ZigLLVM_x86_64) { - lib_path = "lib64"; - } else if (target_is_arm(g->zig_target)) { - const bool is_32 = target_arch_pointer_bit_width(g->zig_target->arch) == 32; - lib_path = is_32 ? "libarm32" : "libarm64"; - } else { - zig_unreachable(); - } - - // Try the archtecture-specific path first - buf_resize(&override_path, 0); - buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "%s" OS_SEP "%s.def", buf_ptr(g->zig_lib_dir), lib_path, name); - - bool does_exist; - if (os_file_exists(&override_path, &does_exist) != ErrorNone) { - zig_panic("link: unable to check if file exists: %s", buf_ptr(&override_path)); - } - - if (!does_exist) { - // Try the generic version - buf_resize(&override_path, 0); - buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "lib-common" OS_SEP "%s.def", buf_ptr(g->zig_lib_dir), name); - - if (os_file_exists(&override_path, &does_exist) != ErrorNone) { - zig_panic("link: unable to check if file exists: %s", buf_ptr(&override_path)); - } - } - - if (!does_exist) { - // Try the generic version and preprocess it - buf_resize(&override_path, 0); - buf_appendf(&override_path, "%s" OS_SEP "libc" OS_SEP "mingw" OS_SEP "lib-common" OS_SEP "%s.def.in", buf_ptr(g->zig_lib_dir), name); - - if (os_file_exists(&override_path, &does_exist) != ErrorNone) { - zig_panic("link: unable to check if file exists: %s", buf_ptr(&override_path)); - } - } - - if (!does_exist) { + if (err == ErrorFileNotFound) { zig_panic("link: could not find .def file to build %s\n", name); + } else if (err != ErrorNone) { + zig_panic("link: unable to check if .def file for %s exists: %s", + name, err_str(err)); } if (always_link || is_linking_system_lib(g, name)) { - lj->args.append(get_def_lib(g, name, &override_path)); + lj->args.append(get_def_lib(g, name, &lib_path)); } } } @@ -2307,8 +2324,6 @@ static void construct_linker_job_coff(LinkJob *lj) { lj->args.append(buf_ptr(compiler_rt_o_path)); } - Buf *def_contents = buf_alloc(); - ZigList gen_lib_args = {0}; for (size_t lib_i = 0; lib_i < g->link_libs_list.length; lib_i += 1) { LinkLib *link_lib = g->link_libs_list.at(lib_i); if (buf_eql_str(link_lib->name, "c")) { @@ -2331,36 +2346,27 @@ static void construct_linker_job_coff(LinkJob *lj) { continue; } - buf_resize(def_contents, 0); - buf_appendf(def_contents, "LIBRARY %s\nEXPORTS\n", buf_ptr(link_lib->name)); - for (size_t exp_i = 0; exp_i < link_lib->symbols.length; exp_i += 1) { - Buf *symbol_name = link_lib->symbols.at(exp_i); - buf_appendf(def_contents, "%s\n", buf_ptr(symbol_name)); - } - buf_appendf(def_contents, "\n"); + // This library may be a system one and we may have a suitable .lib file - Buf *def_path = buf_alloc(); - os_path_join(g->output_dir, buf_sprintf("%s.def", buf_ptr(link_lib->name)), def_path); - if ((err = os_write_file(def_path, def_contents))) { - zig_panic("error writing def file: %s", err_str(err)); + // Normalize the library name to lower case, the FS may be + // case-sensitive + char *name = strdup(buf_ptr(link_lib->name)); + assert(name != nullptr); + for (char *ch = name; *ch; ++ch) *ch = tolower(*ch); + + Buf lib_path = BUF_INIT; + err = find_mingw_lib_def(lj, name, &lib_path); + + if (err == ErrorFileNotFound) { + zig_panic("link: could not find .def file to build %s\n", name); + } else if (err != ErrorNone) { + zig_panic("link: unable to check if .def file for %s exists: %s", + name, err_str(err)); } - Buf *generated_lib_path = buf_alloc(); - os_path_join(g->output_dir, buf_sprintf("%s.lib", buf_ptr(link_lib->name)), generated_lib_path); + lj->args.append(get_def_lib(g, name, &lib_path)); - gen_lib_args.resize(0); - gen_lib_args.append("link"); - - coff_append_machine_arg(g, &gen_lib_args); - gen_lib_args.append(buf_ptr(buf_sprintf("-DEF:%s", buf_ptr(def_path)))); - gen_lib_args.append(buf_ptr(buf_sprintf("-OUT:%s", buf_ptr(generated_lib_path)))); - Buf diag = BUF_INIT; - ZigLLVM_ObjectFormatType target_ofmt = target_object_format(g->zig_target); - if (!zig_lld_link(target_ofmt, gen_lib_args.items, gen_lib_args.length, &diag)) { - fprintf(stderr, "%s\n", buf_ptr(&diag)); - exit(1); - } - lj->args.append(buf_ptr(generated_lib_path)); + free(name); } } diff --git a/test/tests.zig b/test/tests.zig index 66af44da47..84a9c979cd 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -163,6 +163,16 @@ const test_targets = [_]TestTarget{ .disable_native = true, }, + TestTarget{ + .target = Target{ + .Cross = CrossTarget{ + .os = .windows, + .arch = .i386, + .abi = .msvc, + }, + }, + }, + TestTarget{ .target = Target{ .Cross = CrossTarget{ From 30a555eed4d48b602b2c92a05c443e03c4660d48 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 11 Oct 2019 17:08:08 -0400 Subject: [PATCH 12/41] merge dumps tool: merging ast nodes -fgenerate-docs is replaced ith -femit-docs -fno-emit-bin is added to prevent outputting binary --- lib/std/hash.zig | 2 + lib/std/hash_map.zig | 10 +++ lib/std/json/write_stream.zig | 15 +++-- src/all_types.hpp | 1 + src/codegen.cpp | 6 +- src/dump_analysis.cpp | 18 +++--- src/main.cpp | 14 ++++- tools/merge_anal_dumps.zig | 115 ++++++++++++++++++++++++++++++---- 8 files changed, 154 insertions(+), 27 deletions(-) diff --git a/lib/std/hash.zig b/lib/std/hash.zig index ab3a0ea8f3..c51353b328 100644 --- a/lib/std/hash.zig +++ b/lib/std/hash.zig @@ -3,6 +3,8 @@ pub const Adler32 = adler.Adler32; const auto_hash = @import("hash/auto_hash.zig"); pub const autoHash = auto_hash.autoHash; +pub const autoHashStrat = auto_hash.hash; +pub const Strategy = auto_hash.HashStrategy; // pub for polynomials + generic crc32 construction pub const crc = @import("hash/crc.zig"); diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index 4ffe88067b..677dfe4435 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -550,3 +550,13 @@ pub fn getAutoEqlFn(comptime K: type) (fn (K, K) bool) { } }.eql; } + +pub fn getAutoHashStratFn(comptime K: type, comptime strategy: std.hash.Strategy) (fn (K) u32) { + return struct { + fn hash(key: K) u32 { + var hasher = Wyhash.init(0); + std.hash.autoHashStrat(&hasher, key, strategy); + return @truncate(u32, hasher.final()); + } + }.hash; +} diff --git a/lib/std/json/write_stream.zig b/lib/std/json/write_stream.zig index 2bb79a017c..c30f8ba8d8 100644 --- a/lib/std/json/write_stream.zig +++ b/lib/std/json/write_stream.zig @@ -152,10 +152,17 @@ pub fn WriteStream(comptime OutStream: type, comptime max_depth: usize) type { ) !void { assert(self.state[self.state_index] == State.Value); switch (@typeInfo(@typeOf(value))) { - .Int => |info| if (info.bits < 53 or (value < 4503599627370496 and value > -4503599627370496)) { - try self.stream.print("{}", value); - self.popState(); - return; + .Int => |info| { + if (info.bits < 53) { + try self.stream.print("{}", value); + self.popState(); + return; + } + if (value < 4503599627370496 and (!info.is_signed or value > -4503599627370496)) { + try self.stream.print("{}", value); + self.popState(); + return; + } }, .Float => if (@floatCast(f64, value) == value) { try self.stream.print("{}", value); diff --git a/src/all_types.hpp b/src/all_types.hpp index f13a5577d2..0ce55e598b 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -2091,6 +2091,7 @@ struct CodeGen { bool function_sections; bool enable_dump_analysis; bool enable_doc_generation; + bool disable_bin_generation; Buf *mmacosx_version_min; Buf *mios_version_min; diff --git a/src/codegen.cpp b/src/codegen.cpp index e2e117d27a..4cdf22b1eb 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -7586,6 +7586,8 @@ static void zig_llvm_emit_output(CodeGen *g) { char *err_msg = nullptr; switch (g->emit_file_type) { case EmitFileTypeBinary: + if (g->disable_bin_generation) + return; if (ZigLLVMTargetMachineEmitToFile(g->target_machine, g->module, buf_ptr(output_path), ZigLLVM_EmitBinary, &err_msg, g->build_mode == BuildModeDebug, is_small, g->enable_time_report)) @@ -10158,6 +10160,7 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) { cache_bool(ch, g->function_sections); cache_bool(ch, g->enable_dump_analysis); cache_bool(ch, g->enable_doc_generation); + cache_bool(ch, g->disable_bin_generation); cache_buf_opt(ch, g->mmacosx_version_min); cache_buf_opt(ch, g->mios_version_min); cache_usize(ch, g->version_major); @@ -10396,7 +10399,8 @@ void codegen_build_and_link(CodeGen *g) { // If there is more than one object, we have to link them (with -r). // Finally, if we didn't make an object from zig source, and we don't have caching enabled, // then we have an object from C source that we must copy to the output dir which we do with a -r link. - if (g->emit_file_type == EmitFileTypeBinary && (g->out_type != OutTypeObj || g->link_objects.length > 1 || + if (!g->disable_bin_generation && g->emit_file_type == EmitFileTypeBinary && + (g->out_type != OutTypeObj || g->link_objects.length > 1 || (!need_llvm_module(g) && !g->enable_cache))) { codegen_link(g); diff --git a/src/dump_analysis.cpp b/src/dump_analysis.cpp index 6e84095dfd..954f6d2ab2 100644 --- a/src/dump_analysis.cpp +++ b/src/dump_analysis.cpp @@ -1309,15 +1309,6 @@ void zig_print_analysis_dump(CodeGen *g, FILE *f, const char *one_indent, const } jw_end_array(jw); - jw_object_field(jw, "files"); - jw_begin_array(jw); - for (uint32_t i = 0; i < ctx.file_list.length; i += 1) { - Buf *file = ctx.file_list.at(i); - jw_array_elem(jw); - anal_dump_file(&ctx, file); - } - jw_end_array(jw); - jw_object_field(jw, "errors"); jw_begin_array(jw); for (uint32_t i = 0; i < ctx.err_list.length; i += 1) { @@ -1336,5 +1327,14 @@ void zig_print_analysis_dump(CodeGen *g, FILE *f, const char *one_indent, const } jw_end_array(jw); + jw_object_field(jw, "files"); + jw_begin_array(jw); + for (uint32_t i = 0; i < ctx.file_list.length; i += 1) { + Buf *file = ctx.file_list.at(i); + jw_array_elem(jw); + anal_dump_file(&ctx, file); + } + jw_end_array(jw); + jw_end_object(jw); } diff --git a/src/main.cpp b/src/main.cpp index fb2881f3a3..d5901f73bf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -65,7 +65,8 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { " -ftime-report print timing diagnostics\n" " -fstack-report print stack size diagnostics\n" " -fdump-analysis write analysis.json file with type information\n" - " -fgenerate-docs create a docs/ dir with html documentation\n" + " -femit-docs create a docs/ dir with html documentation\n" + " -fno-emit-bin skip emitting machine code\n" " --libc [file] Provide a file which specifies libc paths\n" " --name [name] override output name\n" " --output-dir [dir] override output directory (defaults to cwd)\n" @@ -483,6 +484,7 @@ int main(int argc, char **argv) { bool stack_report = false; bool enable_dump_analysis = false; bool enable_doc_generation = false; + bool disable_bin_generation = false; const char *cache_dir = nullptr; CliPkg *cur_pkg = allocate(1); BuildMode build_mode = BuildModeDebug; @@ -668,8 +670,10 @@ int main(int argc, char **argv) { stack_report = true; } else if (strcmp(arg, "-fdump-analysis") == 0) { enable_dump_analysis = true; - } else if (strcmp(arg, "-fgenerate-docs") == 0) { + } else if (strcmp(arg, "-femit-docs") == 0) { enable_doc_generation = true; + } else if (strcmp(arg, "-fno-emit-bin") == 0) { + disable_bin_generation = true; } else if (strcmp(arg, "--enable-valgrind") == 0) { valgrind_support = ValgrindSupportEnabled; } else if (strcmp(arg, "--disable-valgrind") == 0) { @@ -1148,6 +1152,7 @@ int main(int argc, char **argv) { g->enable_stack_report = stack_report; g->enable_dump_analysis = enable_dump_analysis; g->enable_doc_generation = enable_doc_generation; + g->disable_bin_generation = disable_bin_generation; codegen_set_out_name(g, buf_out_name); codegen_set_lib_version(g, ver_major, ver_minor, ver_patch); g->want_single_threaded = want_single_threaded; @@ -1290,6 +1295,11 @@ int main(int argc, char **argv) { zig_print_stack_report(g, stdout); } + if (g->disable_bin_generation) { + fprintf(stderr, "Semantic analysis complete. No binary produced due to -fno-emit-bin.\n"); + return 0; + } + Buf *test_exe_path_unresolved = &g->output_file_path; Buf *test_exe_path = buf_alloc(); *test_exe_path = os_path_resolve(&test_exe_path_unresolved, 1); diff --git a/tools/merge_anal_dumps.zig b/tools/merge_anal_dumps.zig index 65b21766f4..ccd13999df 100644 --- a/tools/merge_anal_dumps.zig +++ b/tools/merge_anal_dumps.zig @@ -24,19 +24,49 @@ pub fn main() anyerror!void { try dump.render(&stdout.outStream().stream); } +/// AST source node +const Node = struct { + file: usize, + line: usize, + col: usize, + fields: []usize, + + fn hash(n: Node) u32 { + var hasher = std.hash.Wyhash.init(0); + std.hash.autoHash(&hasher, n.file); + std.hash.autoHash(&hasher, n.line); + std.hash.autoHash(&hasher, n.col); + return @truncate(u32, hasher.final()); + } + + fn eql(a: Node, b: Node) bool { + return a.file == b.file and + a.line == b.line and + a.col == b.col; + } +}; + const Dump = struct { zig_id: ?[]const u8 = null, zig_version: ?[]const u8 = null, root_name: ?[]const u8 = null, targets: std.ArrayList([]const u8), - files_list: std.ArrayList([]const u8), - files_map: std.StringHashMap(usize), + + const FileMap = std.StringHashMap(usize); + file_list: std.ArrayList([]const u8), + file_map: FileMap, + + const NodeMap = std.HashMap(Node, usize, Node.hash, Node.eql); + node_list: std.ArrayList(Node), + node_map: NodeMap, fn init(allocator: *mem.Allocator) Dump { return Dump{ .targets = std.ArrayList([]const u8).init(allocator), - .files_list = std.ArrayList([]const u8).init(allocator), - .files_map = std.StringHashMap(usize).init(allocator), + .file_list = std.ArrayList([]const u8).init(allocator), + .file_map = FileMap.init(allocator), + .node_list = std.ArrayList(Node).init(allocator), + .node_map = NodeMap.init(allocator), }; } @@ -56,17 +86,45 @@ const Dump = struct { const other_files = root.Object.get("files").?.value.Array.toSliceConst(); var other_file_to_mine = std.AutoHashMap(usize, usize).init(self.a()); for (other_files) |other_file, i| { - const gop = try self.files_map.getOrPut(other_file.String); - if (gop.found_existing) { - try other_file_to_mine.putNoClobber(i, gop.kv.value); - } else { - gop.kv.value = self.files_list.len; - try self.files_list.append(other_file.String); + const gop = try self.file_map.getOrPut(other_file.String); + if (!gop.found_existing) { + gop.kv.value = self.file_list.len; + try self.file_list.append(other_file.String); } + try other_file_to_mine.putNoClobber(i, gop.kv.value); } + // Merge ast nodes const other_ast_nodes = root.Object.get("astNodes").?.value.Array.toSliceConst(); var other_ast_node_to_mine = std.AutoHashMap(usize, usize).init(self.a()); + for (other_ast_nodes) |other_ast_node_json, i| { + const other_file_id = jsonObjInt(other_ast_node_json, "file"); + const other_node = Node{ + .line = jsonObjInt(other_ast_node_json, "line"), + .col = jsonObjInt(other_ast_node_json, "col"), + .file = other_file_to_mine.getValue(other_file_id).?, + .fields = ([*]usize)(undefined)[0..0], + }; + const gop = try self.node_map.getOrPut(other_node); + if (!gop.found_existing) { + gop.kv.value = self.node_list.len; + try self.node_list.append(other_node); + } + try other_ast_node_to_mine.putNoClobber(i, gop.kv.value); + } + // convert fields lists + for (other_ast_nodes) |other_ast_node_json, i| { + const my_node_index = other_ast_node_to_mine.get(i).?.value; + const my_node = &self.node_list.toSlice()[my_node_index]; + if (other_ast_node_json.Object.get("fields")) |fields_json_kv| { + const other_fields = fields_json_kv.value.Array.toSliceConst(); + my_node.fields = try self.a().alloc(usize, other_fields.len); + for (other_fields) |other_field_index, field_i| { + const other_index = @intCast(usize, other_field_index.Integer); + my_node.fields[field_i] = other_ast_node_to_mine.get(other_index).?.value; + } + } + } } fn render(self: *Dump, stream: var) !void { @@ -81,9 +139,39 @@ const Dump = struct { } try jw.endArray(); + try jw.objectField("astNodes"); + try jw.beginArray(); + for (self.node_list.toSliceConst()) |node| { + try jw.arrayElem(); + try jw.beginObject(); + + try jw.objectField("file"); + try jw.emitNumber(node.file); + + try jw.objectField("line"); + try jw.emitNumber(node.line); + + try jw.objectField("col"); + try jw.emitNumber(node.col); + + if (node.fields.len != 0) { + try jw.objectField("fields"); + try jw.beginArray(); + + for (node.fields) |field_node_index| { + try jw.arrayElem(); + try jw.emitNumber(field_node_index); + } + try jw.endArray(); + } + + try jw.endObject(); + } + try jw.endArray(); + try jw.objectField("files"); try jw.beginArray(); - for (self.files_list.toSliceConst()) |file| { + for (self.file_list.toSliceConst()) |file| { try jw.arrayElem(); try jw.emitString(file); } @@ -105,3 +193,8 @@ const Dump = struct { } } }; + +fn jsonObjInt(json_val: json.Value, field: []const u8) usize { + const uncasted = json_val.Object.get(field).?.value.Integer; + return @intCast(usize, uncasted); +} From 8b45921664c8f679c8154b45add84f84e3ec8128 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 11 Oct 2019 17:21:13 -0400 Subject: [PATCH 13/41] merge targets of generated docs --- lib/std/special/docs/main.js | 2 +- src/dump_analysis.cpp | 6 ++++++ tools/merge_anal_dumps.zig | 37 ++++++++++++++++++++++++++++++++---- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/lib/std/special/docs/main.js b/lib/std/special/docs/main.js index 7bc8bb0e97..3650d46ec6 100644 --- a/lib/std/special/docs/main.js +++ b/lib/std/special/docs/main.js @@ -305,7 +305,7 @@ function renderInfo() { domTdZigVer.textContent = zigAnalysis.params.zigVersion; - domTdTarget.textContent = zigAnalysis.params.target; + domTdTarget.textContent = zigAnalysis.params.builds[0].target; domSectInfo.classList.remove("hidden"); } diff --git a/src/dump_analysis.cpp b/src/dump_analysis.cpp index 954f6d2ab2..61a40ebfcc 100644 --- a/src/dump_analysis.cpp +++ b/src/dump_analysis.cpp @@ -1207,10 +1207,16 @@ void zig_print_analysis_dump(CodeGen *g, FILE *f, const char *one_indent, const jw_object_field(jw, "zigVersion"); jw_string(jw, ZIG_VERSION_STRING); + jw_object_field(jw, "builds"); + jw_begin_array(jw); + jw_array_elem(jw); + jw_begin_object(jw); jw_object_field(jw, "target"); Buf triple_buf = BUF_INIT; target_triple_zig(&triple_buf, g->zig_target); jw_string(jw, buf_ptr(&triple_buf)); + jw_end_object(jw); + jw_end_array(jw); jw_object_field(jw, "rootName"); jw_string(jw, buf_ptr(g->root_out_name)); diff --git a/tools/merge_anal_dumps.zig b/tools/merge_anal_dumps.zig index ccd13999df..53f9e438aa 100644 --- a/tools/merge_anal_dumps.zig +++ b/tools/merge_anal_dumps.zig @@ -79,10 +79,12 @@ const Dump = struct { try mergeSameStrings(&self.zig_version, zig_version); try mergeSameStrings(&self.root_name, root_name); - const target = params.get("target").?.value.String; - try self.targets.append(target); + for (params.get("builds").?.value.Array.toSliceConst()) |json_build| { + const target = json_build.Object.get("target").?.value.String; + try self.targets.append(target); + } - // Merge files + // Merge files. If the string matches, it's the same file. const other_files = root.Object.get("files").?.value.Array.toSliceConst(); var other_file_to_mine = std.AutoHashMap(usize, usize).init(self.a()); for (other_files) |other_file, i| { @@ -94,7 +96,7 @@ const Dump = struct { try other_file_to_mine.putNoClobber(i, gop.kv.value); } - // Merge ast nodes + // Merge AST nodes. If the file id, line, and column all match, it's the same AST node. const other_ast_nodes = root.Object.get("astNodes").?.value.Array.toSliceConst(); var other_ast_node_to_mine = std.AutoHashMap(usize, usize).init(self.a()); for (other_ast_nodes) |other_ast_node_json, i| { @@ -125,6 +127,8 @@ const Dump = struct { } } } + + // Merge errors. If the AST Node matches, it's the same error value. } fn render(self: *Dump, stream: var) !void { @@ -139,6 +143,31 @@ const Dump = struct { } try jw.endArray(); + try jw.objectField("params"); + try jw.beginObject(); + + try jw.objectField("zigId"); + try jw.emitString(self.zig_id.?); + + try jw.objectField("zigVersion"); + try jw.emitString(self.zig_version.?); + + try jw.objectField("rootName"); + try jw.emitString(self.root_name.?); + + try jw.objectField("builds"); + try jw.beginArray(); + for (self.targets.toSliceConst()) |target| { + try jw.arrayElem(); + try jw.beginObject(); + try jw.objectField("target"); + try jw.emitString(target); + try jw.endObject(); + } + try jw.endArray(); + + try jw.endObject(); + try jw.objectField("astNodes"); try jw.beginArray(); for (self.node_list.toSliceConst()) |node| { From 2b624fea84abdd963ea06aca648b4da1477ec65f Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 12 Oct 2019 10:56:16 +0200 Subject: [PATCH 14/41] Add dlltool functionality Don't need no patched lld --kill-at behaviour now. --- src/link.cpp | 27 ++++------------ src/zig_llvm.cpp | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ src/zig_llvm.h | 3 ++ 3 files changed, 91 insertions(+), 21 deletions(-) diff --git a/src/link.cpp b/src/link.cpp index de35a18f33..61192724f2 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -2054,27 +2054,12 @@ static const char *get_def_lib(CodeGen *parent, const char *name, Buf *def_in_fi lib_final_path = buf_alloc(); os_path_join(artifact_dir, final_lib_basename, lib_final_path); - args.resize(0); - args.append("link"); - coff_append_machine_arg(parent, &args); - args.append("-lldmingw"); - args.append("-kill-at"); - - args.append(buf_ptr(buf_sprintf("-DEF:%s", buf_ptr(def_final_path)))); - args.append(buf_ptr(buf_sprintf("-OUT:%s", buf_ptr(lib_final_path)))); - - if (parent->verbose_link) { - for (size_t i = 0; i < args.length; i += 1) { - fprintf(stderr, "%s ", args.at(i)); - } - fprintf(stderr, "\n"); - } - - Buf diag = BUF_INIT; - ZigLLVM_ObjectFormatType target_ofmt = target_object_format(parent->zig_target); - if (!zig_lld_link(target_ofmt, args.items, args.length, &diag)) { - fprintf(stderr, "%s\n", buf_ptr(&diag)); - exit(1); + if (ZigLLVMWriteImportLibrary(buf_ptr(def_final_path), + parent->zig_target->arch, + buf_ptr(lib_final_path), + /* kill_at */ true)) + { + zig_panic("link: could not emit %s", buf_ptr(lib_final_path)); } } else { // cache hit diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index 8166173051..ac17e6edfe 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -34,6 +34,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -938,6 +941,85 @@ class MyOStream: public raw_ostream { size_t pos; }; +bool ZigLLVMWriteImportLibrary(const char *def_path, const ZigLLVM_ArchType arch, + const char *output_lib_path, const bool kill_at) +{ + COFF::MachineTypes machine = COFF::IMAGE_FILE_MACHINE_UNKNOWN; + + switch (arch) { + case ZigLLVM_x86: + machine = COFF::IMAGE_FILE_MACHINE_I386; + break; + case ZigLLVM_x86_64: + machine = COFF::IMAGE_FILE_MACHINE_AMD64; + break; + case ZigLLVM_arm: + case ZigLLVM_armeb: + case ZigLLVM_thumb: + case ZigLLVM_thumbeb: + machine = COFF::IMAGE_FILE_MACHINE_ARMNT; + break; + case ZigLLVM_aarch64: + case ZigLLVM_aarch64_be: + machine = COFF::IMAGE_FILE_MACHINE_ARM64; + break; + default: + break; + } + + if (machine == COFF::IMAGE_FILE_MACHINE_UNKNOWN) { + return true; + } + + auto bufOrErr = MemoryBuffer::getFile(def_path); + if (!bufOrErr) { + return false; + } + + MemoryBuffer& buf = *bufOrErr.get(); + Expected def = + object::parseCOFFModuleDefinition(buf, machine, /* MingwDef */ true); + + if (!def) { + return true; + } + + // The exports-juggling code below is ripped from LLVM's DllToolDriver.cpp + + // If ExtName is set (if the "ExtName = Name" syntax was used), overwrite + // Name with ExtName and clear ExtName. When only creating an import + // library and not linking, the internal name is irrelevant. This avoids + // cases where writeImportLibrary tries to transplant decoration from + // symbol decoration onto ExtName. + for (object::COFFShortExport& E : def->Exports) { + if (!E.ExtName.empty()) { + E.Name = E.ExtName; + E.ExtName.clear(); + } + } + + if (machine == COFF::IMAGE_FILE_MACHINE_I386 && kill_at) { + for (object::COFFShortExport& E : def->Exports) { + if (!E.AliasTarget.empty() || (!E.Name.empty() && E.Name[0] == '?')) + continue; + E.SymbolName = E.Name; + // Trim off the trailing decoration. Symbols will always have a + // starting prefix here (either _ for cdecl/stdcall, @ for fastcall + // or ? for C++ functions). Vectorcall functions won't have any + // fixed prefix, but the function base name will still be at least + // one char. + E.Name = E.Name.substr(0, E.Name.find('@', 1)); + // By making sure E.SymbolName != E.Name for decorated symbols, + // writeImportLibrary writes these symbols with the type + // IMPORT_NAME_UNDECORATE. + } + } + + return static_cast( + object::writeImportLibrary(def->OutputFile, output_lib_path, + def->Exports, machine, /* MinGW */ true)); +} + bool ZigLLVMWriteArchive(const char *archive_name, const char **file_names, size_t file_name_count, ZigLLVM_OSType os_type) { diff --git a/src/zig_llvm.h b/src/zig_llvm.h index 8522a03c40..a3043b7e25 100644 --- a/src/zig_llvm.h +++ b/src/zig_llvm.h @@ -465,6 +465,9 @@ ZIG_EXTERN_C bool ZigLLDLink(enum ZigLLVM_ObjectFormatType oformat, const char * ZIG_EXTERN_C bool ZigLLVMWriteArchive(const char *archive_name, const char **file_names, size_t file_name_count, enum ZigLLVM_OSType os_type); +bool ZigLLVMWriteImportLibrary(const char *def_path, const ZigLLVM_ArchType arch, + const char *output_lib_path, const bool kill_at); + ZIG_EXTERN_C void ZigLLVMGetNativeTarget(enum ZigLLVM_ArchType *arch_type, enum ZigLLVM_SubArchType *sub_arch_type, enum ZigLLVM_VendorType *vendor_type, enum ZigLLVM_OSType *os_type, enum ZigLLVM_EnvironmentType *environ_type, enum ZigLLVM_ObjectFormatType *oformat); From 60cf3f8a8c26ad4131c5842238cefe6b45a67d9f Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 12 Oct 2019 10:57:11 +0200 Subject: [PATCH 15/41] Revert LLD patch The source is now squeaky-clean again. --- deps/lld/COFF/DriverUtils.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/deps/lld/COFF/DriverUtils.cpp b/deps/lld/COFF/DriverUtils.cpp index 5003a99da4..4360ac23b2 100644 --- a/deps/lld/COFF/DriverUtils.cpp +++ b/deps/lld/COFF/DriverUtils.cpp @@ -638,18 +638,10 @@ void fixupExports() { if (config->killAt && config->machine == I386) { for (Export &e : config->exports) { - if (!e.name.empty() && e.name[0] == '?') - continue; - e.symbolName = e.name; - // Trim off the trailing decoration. Symbols will always have a - // starting prefix here (either _ for cdecl/stdcall, @ for fastcall - // or ? for C++ functions). Vectorcall functions won't have any - // fixed prefix, but the function base name will still be at least - // one char. - e.name = e.name.substr(0, e.name.find('@', 1)); - // By making sure E.SymbolName != E.Name for decorated symbols, - // writeImportLibrary writes these symbols with the type - // IMPORT_NAME_UNDECORATE. + e.name = killAt(e.name, true); + e.exportName = killAt(e.exportName, false); + e.extName = killAt(e.extName, true); + e.symbolName = killAt(e.symbolName, true); } } From 40fc7a1fdac23b1799ebce69c2a65236886bc360 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 12 Oct 2019 14:55:02 +0200 Subject: [PATCH 16/41] Add support for the statx syscall --- lib/std/os/bits/linux.zig | 78 +++++++++++++++++++++++++++++++++++++++ lib/std/os/linux.zig | 14 +++++++ lib/std/os/linux/test.zig | 32 ++++++++++++++++ 3 files changed, 124 insertions(+) diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index 5ed5c0b622..0d70a6bcaa 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -1293,3 +1293,81 @@ pub const utsname = extern struct { domainname: [65]u8, }; pub const HOST_NAME_MAX = 64; + +pub const STATX_TYPE = 0x0001; +pub const STATX_MODE = 0x0002; +pub const STATX_NLINK = 0x0004; +pub const STATX_UID = 0x0008; +pub const STATX_GID = 0x0010; +pub const STATX_ATIME = 0x0020; +pub const STATX_MTIME = 0x0040; +pub const STATX_CTIME = 0x0080; +pub const STATX_INO = 0x0100; +pub const STATX_SIZE = 0x0200; +pub const STATX_BLOCKS = 0x0400; +pub const STATX_BASIC_STATS = 0x07ff; + +pub const STATX_BTIME = 0x0800; + +pub const STATX_ATTR_COMPRESSED = 0x0004; +pub const STATX_ATTR_IMMUTABLE = 0x0010; +pub const STATX_ATTR_APPEND = 0x0020; +pub const STATX_ATTR_NODUMP = 0x0040; +pub const STATX_ATTR_ENCRYPTED = 0x0800; +pub const STATX_ATTR_AUTOMOUNT = 0x1000; + +pub const statx_timestamp = extern struct { + tv_sec: i64, + tv_nsec: u32, + __pad1: u32, +}; + +pub const Statx = extern struct { + // Mask of bits indicating filled fields + stx_mask: u32, + // Block size for filesystem I/O + stx_blksize: u32, + // Extra file attribute indicators + stx_attributes: u64, + // Number of hard links + stx_nlink: u32, + // User ID of owner + stx_uid: u32, + // Group ID of owner + stx_gid: u32, + // File type and mode + stx_mode: u16, + __pad1: u16, + // Inode number + stx_ino: u64, + // Total size in bytes + stx_size: u64, + // Number of 512B blocks allocated + stx_blocks: u64, + // Mask to show what's supported in stx_attributes + stx_attributes_mask: u64, + + // The following fields are file timestamps + // Last access + stx_atime: statx_timestamp, + // Creation + stx_btime: statx_timestamp, + // Last status change + stx_ctime: statx_timestamp, + // Last modification + stx_mtime: statx_timestamp, + + // If this file represents a device, then the next two fields contain the ID of the device + // Major ID + stx_rdev_major: u32, + // Minor ID + stx_rdev_minor: u32, + + // The next two fields contain the ID of the device containing the filesystem where the file resides + // Major ID + stx_dev_major: u32, + // Minor ID + stx_dev_minor: u32, + + __pad2: [14]u64, +}; diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 46aeb28f2f..c91b6ad98b 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -860,6 +860,20 @@ pub fn fstatat(dirfd: i32, path: [*]const u8, stat_buf: *Stat, flags: u32) usize } } +pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *Statx) usize { + if (@hasDecl(@This(), "SYS_statx")) { + return syscall5( + SYS_statx, + @bitCast(usize, isize(dirfd)), + @ptrToInt(path), + flags, + mask, + @ptrToInt(statx_buf), + ); + } + return @bitCast(usize, isize(-ENOSYS)); +} + // TODO https://github.com/ziglang/zig/issues/265 pub fn listxattr(path: [*]const u8, list: [*]u8, size: usize) usize { return syscall3(SYS_listxattr, @ptrToInt(path), @ptrToInt(list), size); diff --git a/lib/std/os/linux/test.zig b/lib/std/os/linux/test.zig index 97bbcc402d..3782bc3301 100644 --- a/lib/std/os/linux/test.zig +++ b/lib/std/os/linux/test.zig @@ -44,3 +44,35 @@ test "timer" { // TODO implicit cast from *[N]T to [*]T err = linux.epoll_wait(@intCast(i32, epoll_fd), @ptrCast([*]linux.epoll_event, &events), 8, -1); } + +const File = std.fs.File; + +test "statx" { + const tmp_file_name = "just_a_temporary_file.txt"; + var file = try File.openWrite(tmp_file_name); + defer { + file.close(); + std.fs.deleteFile(tmp_file_name) catch {}; + } + + var statx_buf: linux.Statx = undefined; + switch (linux.getErrno(linux.statx(file.handle, c"", linux.AT_EMPTY_PATH, linux.STATX_BASIC_STATS, &statx_buf))) { + 0 => {}, + // The statx syscall was only introduced in linux 4.11 + linux.ENOSYS => return error.SkipZigTest, + else => unreachable, + } + + var stat_buf: linux.Stat = undefined; + switch (linux.getErrno(linux.fstatat(file.handle, c"", &stat_buf, linux.AT_EMPTY_PATH))) { + 0 => {}, + else => unreachable, + } + + expect(stat_buf.mode == statx_buf.stx_mode); + expect(@bitCast(u32, stat_buf.uid) == statx_buf.stx_uid); + expect(@bitCast(u32, stat_buf.gid) == statx_buf.stx_gid); + expect(@bitCast(u64, i64(stat_buf.size)) == statx_buf.stx_size); + expect(@bitCast(u64, i64(stat_buf.blksize)) == statx_buf.stx_blksize); + expect(@bitCast(u64, i64(stat_buf.blocks)) == statx_buf.stx_blocks); +} From ead9630c135b86c77de9774635f7b5c55ce62f41 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 12 Oct 2019 20:52:10 +0200 Subject: [PATCH 17/41] Fix signedness for some fields in ARM stat definition --- lib/std/os/bits/linux/arm-eabi.zig | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/lib/std/os/bits/linux/arm-eabi.zig b/lib/std/os/bits/linux/arm-eabi.zig index ae169684fe..a5b6a31c60 100644 --- a/lib/std/os/bits/linux/arm-eabi.zig +++ b/lib/std/os/bits/linux/arm-eabi.zig @@ -6,6 +6,8 @@ const iovec = linux.iovec; const iovec_const = linux.iovec_const; const stack_t = linux.stack_t; const sigset_t = linux.sigset_t; +const uid_t = linux.uid_t; +const gid_t = linux.gid_t; pub const SYS_restart_syscall = 0; pub const SYS_exit = 1; @@ -512,7 +514,14 @@ pub const msghdr_const = extern struct { msg_flags: i32, }; +pub const blksize_t = i32; +pub const nlink_t = u32; +pub const time_t = isize; +pub const mode_t = u32; pub const off_t = i64; +pub const ino_t = u64; +pub const dev_t = u64; +pub const blkcnt_t = i64; /// Renamed to Stat to not conflict with the stat function. /// atime, mtime, and ctime have functions to return `timespec`, @@ -521,22 +530,22 @@ pub const off_t = i64; /// in C, macros are used to hide the differences. Here we use /// methods to accomplish this. pub const Stat = extern struct { - dev: u64, + dev: dev_t, __dev_padding: u32, __ino_truncated: u32, - mode: u32, - nlink: u32, - uid: u32, - gid: u32, - rdev: u64, + mode: mode_t, + nlink: nlink_t, + uid: uid_t, + gid: gid_t, + rdev: dev_t, __rdev_padding: u32, size: off_t, - blksize: i32, - blocks: u64, + blksize: blksize_t, + blocks: blkcnt_t, atim: timespec, mtim: timespec, ctim: timespec, - ino: u64, + ino: ino_t, pub fn atime(self: Stat) timespec { return self.atim; From ba711f1115b76d85b13fc64636c4a4af8405cc1e Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 13 Oct 2019 12:12:33 +0200 Subject: [PATCH 18/41] Add ELF architecture constant for RISC-V --- lib/std/elf.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/elf.zig b/lib/std/elf.zig index 37635895fd..b3aea3e5c6 100644 --- a/lib/std/elf.zig +++ b/lib/std/elf.zig @@ -338,6 +338,7 @@ pub const Arch = enum { IA_64, x86_64, AArch64, + RiscV, }; pub const SectionHeader = struct { @@ -428,6 +429,7 @@ pub const Elf = struct { 0x32 => Arch.IA_64, 0x3E => Arch.x86_64, 0xb7 => Arch.AArch64, + 0xf3 => Arch.RiscV, else => return error.InvalidFormat, }; From b1f3f59d660bbe163502daa6f0acd560782f49d8 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 13 Oct 2019 12:13:41 +0200 Subject: [PATCH 19/41] Fix fp-based backtracing on RISC-V The fp points to the top of the frame instead of pointing to the old fp, compensate this difference with an offset. --- lib/std/debug.zig | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/std/debug.zig b/lib/std/debug.zig index a6bc0fedf3..41270bcd82 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -280,14 +280,23 @@ pub const StackIterator = struct { }; } + // On some architectures such as x86 the frame pointer is the address where + // the previous fp is stored, while on some other architectures such as + // RISC-V it points to the "top" of the frame, just above where the previous + // fp and the return address are stored. + const fp_adjust_factor = if (builtin.arch == .riscv32 or builtin.arch == .riscv64) + 2 * @sizeOf(usize) + else + 0; + fn next(self: *StackIterator) ?usize { - if (self.fp == 0) return null; - self.fp = @intToPtr(*const usize, self.fp).*; - if (self.fp == 0) return null; + if (self.fp < fp_adjust_factor) return null; + self.fp = @intToPtr(*const usize, self.fp - fp_adjust_factor).*; + if (self.fp < fp_adjust_factor) return null; if (self.first_addr) |addr| { - while (self.fp != 0) : (self.fp = @intToPtr(*const usize, self.fp).*) { - const return_address = @intToPtr(*const usize, self.fp + @sizeOf(usize)).*; + while (self.fp >= fp_adjust_factor) : (self.fp = @intToPtr(*const usize, self.fp - fp_adjust_factor).*) { + const return_address = @intToPtr(*const usize, self.fp - fp_adjust_factor + @sizeOf(usize)).*; if (addr == return_address) { self.first_addr = null; return return_address; @@ -295,7 +304,7 @@ pub const StackIterator = struct { } } - const return_address = @intToPtr(*const usize, self.fp + @sizeOf(usize)).*; + const return_address = @intToPtr(*const usize, self.fp - fp_adjust_factor + @sizeOf(usize)).*; return return_address; } }; From 22e60df68024f3fd72c91ec7b17dbf7abc71c86c Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 13 Oct 2019 12:14:30 +0200 Subject: [PATCH 20/41] Propagate user-defined function alignment to LLVM IR --- src/analyze.cpp | 5 ++++- test/stage1/behavior/align.zig | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/analyze.cpp b/src/analyze.cpp index a38766bc25..399966d041 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1787,6 +1787,7 @@ static ZigType *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *child_sc if (!analyze_const_align(g, child_scope, fn_proto->align_expr, &fn_type_id.alignment)) { return g->builtin_types.entry_invalid; } + fn_entry->align_bytes = fn_type_id.alignment; } if (fn_proto->return_var_token != nullptr) { @@ -3327,7 +3328,9 @@ static void resolve_decl_fn(CodeGen *g, TldFn *tld_fn) { fn_table_entry->type_entry = analyze_fn_type(g, source_node, child_scope, fn_table_entry); if (fn_proto->section_expr != nullptr) { - analyze_const_string(g, child_scope, fn_proto->section_expr, &fn_table_entry->section_name); + if (!analyze_const_string(g, child_scope, fn_proto->section_expr, &fn_table_entry->section_name)) { + fn_table_entry->type_entry = g->builtin_types.entry_invalid; + } } if (fn_table_entry->type_entry->id == ZigTypeIdInvalid) { diff --git a/test/stage1/behavior/align.zig b/test/stage1/behavior/align.zig index 266e5d3519..bb40270cda 100644 --- a/test/stage1/behavior/align.zig +++ b/test/stage1/behavior/align.zig @@ -328,3 +328,10 @@ test "align(@alignOf(T)) T does not force resolution of T" { _ = async S.doTheTest(); expect(S.ok); } + +test "align(N) on functions" { + expect((@ptrToInt(overaligned_fn) & (0x1000 - 1)) == 0); +} +fn overaligned_fn() align(0x1000) i32 { + return 42; +} From ae0628b30cdde8068dbefcbe6827f3339a9da088 Mon Sep 17 00:00:00 2001 From: Sahnvour Date: Sun, 13 Oct 2019 13:44:33 +0200 Subject: [PATCH 21/41] ci: use parallel msbuild.exe processes for faster building on windows --- ci/azure/windows_script.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/azure/windows_script.bat b/ci/azure/windows_script.bat index 5c44abcbe1..57140e19b5 100644 --- a/ci/azure/windows_script.bat +++ b/ci/azure/windows_script.bat @@ -19,7 +19,7 @@ mkdir %ZIGBUILDDIR% cd %ZIGBUILDDIR% REM Here we use MinSizeRel instead of Release to work around https://github.com/ziglang/zig/issues/3024 cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=MinSizeRel || exit /b -msbuild /p:Configuration=MinSizeRel INSTALL.vcxproj || exit /b +msbuild /maxcpucount /p:Configuration=MinSizeRel INSTALL.vcxproj || exit /b "%ZIGINSTALLDIR%\bin\zig.exe" build test || exit /b From b164e0ae5599610e39804845331caab612010c13 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 13 Oct 2019 17:37:04 +0200 Subject: [PATCH 22/41] Fix stack iteration stop condition --- lib/std/debug.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 41270bcd82..0be778b3b6 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -290,12 +290,12 @@ pub const StackIterator = struct { 0; fn next(self: *StackIterator) ?usize { - if (self.fp < fp_adjust_factor) return null; + if (self.fp <= fp_adjust_factor) return null; self.fp = @intToPtr(*const usize, self.fp - fp_adjust_factor).*; - if (self.fp < fp_adjust_factor) return null; + if (self.fp <= fp_adjust_factor) return null; if (self.first_addr) |addr| { - while (self.fp >= fp_adjust_factor) : (self.fp = @intToPtr(*const usize, self.fp - fp_adjust_factor).*) { + while (self.fp > fp_adjust_factor) : (self.fp = @intToPtr(*const usize, self.fp - fp_adjust_factor).*) { const return_address = @intToPtr(*const usize, self.fp - fp_adjust_factor + @sizeOf(usize)).*; if (addr == return_address) { self.first_addr = null; From 7495fd8cb9eea3d571ec62eff069b443ac0e3a6a Mon Sep 17 00:00:00 2001 From: Vexu <15308111+Vexu@users.noreply.github.com> Date: Tue, 15 Oct 2019 14:06:08 +0300 Subject: [PATCH 23/41] fix struct align fmt --- lib/std/zig/parser_test.zig | 6 ++++++ lib/std/zig/render.zig | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/std/zig/parser_test.zig b/lib/std/zig/parser_test.zig index 2c7978ba83..78f80786c5 100644 --- a/lib/std/zig/parser_test.zig +++ b/lib/std/zig/parser_test.zig @@ -173,6 +173,12 @@ test "zig fmt: aligned struct field" { \\}; \\ ); + try testCanonical( + \\pub const S = struct { + \\ f: i32 align(32) = 1, + \\}; + \\ + ); } test "zig fmt: preserve space between async fn definitions" { diff --git a/lib/std/zig/render.zig b/lib/std/zig/render.zig index 6268a056f5..1be4410f38 100644 --- a/lib/std/zig/render.zig +++ b/lib/std/zig/render.zig @@ -272,7 +272,7 @@ fn renderTopLevelDecl(allocator: *mem.Allocator, stream: var, tree: *ast.Tree, i try renderToken(tree, stream, align_kw, indent, start_col, Space.None); // align try renderToken(tree, stream, lparen_token, indent, start_col, Space.None); // ( try renderExpression(allocator, stream, tree, indent, start_col, align_value_expr, Space.None); // alignment - try renderToken(tree, stream, rparen_token, indent, start_col, Space.Comma); // ) + try renderToken(tree, stream, rparen_token, indent, start_col, Space.Comma); // ), } else { try renderExpression(allocator, stream, tree, indent, start_col, field.type_expr.?, Space.Comma); // type, } @@ -283,8 +283,20 @@ fn renderTopLevelDecl(allocator: *mem.Allocator, stream: var, tree: *ast.Tree, i } else { try renderToken(tree, stream, field.name_token, indent, start_col, Space.None); // name try renderToken(tree, stream, tree.nextToken(field.name_token), indent, start_col, Space.Space); // : - try renderExpression(allocator, stream, tree, indent, start_col, field.type_expr.?, Space.Space); // type - try renderToken(tree, stream, tree.nextToken(field.type_expr.?.lastToken()), indent, start_col, Space.Space); // = + + if (field.align_expr) |align_value_expr| { + try renderExpression(allocator, stream, tree, indent, start_col, field.type_expr.?, Space.Space); // type + const lparen_token = tree.prevToken(align_value_expr.firstToken()); + const align_kw = tree.prevToken(lparen_token); + const rparen_token = tree.nextToken(align_value_expr.lastToken()); + try renderToken(tree, stream, align_kw, indent, start_col, Space.None); // align + try renderToken(tree, stream, lparen_token, indent, start_col, Space.None); // ( + try renderExpression(allocator, stream, tree, indent, start_col, align_value_expr, Space.None); // alignment + try renderToken(tree, stream, rparen_token, indent, start_col, Space.Space); // ) + } else { + try renderExpression(allocator, stream, tree, indent, start_col, field.type_expr.?, Space.Space); // type + } + try renderToken(tree, stream, tree.prevToken(field.value_expr.?.firstToken()), indent, start_col, Space.Space); // = return renderExpression(allocator, stream, tree, indent, start_col, field.value_expr.?, Space.Comma); // value, } }, From 9050cd847a2a767df34bc3e0bbc9c789b8a49a91 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 15 Oct 2019 17:58:26 -0400 Subject: [PATCH 24/41] fix non-byte-aligned packed struct field... ...passed as generic fn parameter causing invalid LLVM IR. closes #3460 --- src/analyze.cpp | 11 +++++++++++ src/codegen.cpp | 15 +++++++++++++-- test/stage1/behavior/struct.zig | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/analyze.cpp b/src/analyze.cpp index 399966d041..92b221a2ec 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -8602,6 +8602,9 @@ static void resolve_llvm_types_fn_type(CodeGen *g, ZigType *fn_type) { fn_type->llvm_di_type = ZigLLVMCreateDebugPointerType(g->dbuilder, fn_type->data.fn.raw_di_type, LLVMStoreSizeOfType(g->target_data_ref, fn_type->llvm_type), LLVMABIAlignmentOfType(g->target_data_ref, fn_type->llvm_type), ""); + + gen_param_types.deinit(); + param_di_types.deinit(); } void resolve_llvm_types_fn(CodeGen *g, ZigFn *fn) { @@ -8636,6 +8639,9 @@ void resolve_llvm_types_fn(CodeGen *g, ZigFn *fn) { fn->raw_type_ref = LLVMFunctionType(get_llvm_type(g, gen_return_type), gen_param_types.items, gen_param_types.length, false); fn->raw_di_type = ZigLLVMCreateSubroutineType(g->dbuilder, param_di_types.items, (int)param_di_types.length, 0); + + param_di_types.deinit(); + gen_param_types.deinit(); } static void resolve_llvm_types_anyerror(CodeGen *g) { @@ -8660,6 +8666,8 @@ static void resolve_llvm_types_anyerror(CodeGen *g) { tag_debug_align_in_bits, err_enumerators.items, err_enumerators.length, get_llvm_di_type(g, g->err_tag_type), ""); + + err_enumerators.deinit(); } static void resolve_llvm_types_async_frame(CodeGen *g, ZigType *frame_type, ResolveStatus wanted_resolve_status) { @@ -8805,6 +8813,9 @@ static void resolve_llvm_types_any_frame(CodeGen *g, ZigType *any_frame_type, Re nullptr, di_element_types.items, di_element_types.length, 0, nullptr, ""); ZigLLVMReplaceTemporary(g->dbuilder, frame_header_di_type, replacement_di_type); + + field_types.deinit(); + di_element_types.deinit(); } static void resolve_llvm_types(CodeGen *g, ZigType *type, ResolveStatus wanted_resolve_status) { diff --git a/src/codegen.cpp b/src/codegen.cpp index 4cdf22b1eb..f313c6cd1c 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -4245,8 +4245,19 @@ static LLVMValueRef ir_render_struct_field_ptr(CodeGen *g, IrExecutable *executa if ((err = type_resolve(g, struct_type, ResolveStatusLLVMFull))) codegen_report_errors_and_exit(g); - assert(field->gen_index != SIZE_MAX); - return LLVMBuildStructGEP(g->builder, struct_ptr, (unsigned)field->gen_index, ""); + src_assert(field->gen_index != SIZE_MAX, instruction->base.source_node); + LLVMValueRef field_ptr_val = LLVMBuildStructGEP(g->builder, struct_ptr, (unsigned)field->gen_index, ""); + ZigType *res_type = instruction->base.value.type; + src_assert(res_type->id == ZigTypeIdPointer, instruction->base.source_node); + if (res_type->data.pointer.host_int_bytes != 0) { + // We generate packed structs with get_llvm_type_of_n_bytes, which is + // u8 for 1 byte or [n]u8 for multiple bytes. But the pointer to the type + // is supposed to be a pointer to the integer. So we bitcast it here. + LLVMTypeRef int_elem_type = LLVMIntType(8*res_type->data.pointer.host_int_bytes); + LLVMTypeRef integer_ptr_type = LLVMPointerType(int_elem_type, 0); + return LLVMBuildBitCast(g->builder, field_ptr_val, integer_ptr_type, ""); + } + return field_ptr_val; } static LLVMValueRef ir_render_union_field_ptr(CodeGen *g, IrExecutable *executable, diff --git a/test/stage1/behavior/struct.zig b/test/stage1/behavior/struct.zig index c0dc580c36..ede31c0162 100644 --- a/test/stage1/behavior/struct.zig +++ b/test/stage1/behavior/struct.zig @@ -689,3 +689,23 @@ test "non-packed struct with u128 entry in union" { s.f2 = v2; std.testing.expect(s.f2.Num == 123); } + +test "packed struct field passed to generic function" { + const S = struct { + const P = packed struct { + b: u5, + g: u5, + r: u5, + a: u1, + }; + + fn genericReadPackedField(ptr: var) u5 { + return ptr.*; + } + }; + + var p: S.P = undefined; + p.b = 29; + var loaded = S.genericReadPackedField(&p.b); + expect(loaded == 29); +} From 6a629d3a9f60b185ad24adb7b88b1f29b66e38cf Mon Sep 17 00:00:00 2001 From: tgschultz Date: Tue, 15 Oct 2019 19:29:47 +0000 Subject: [PATCH 25/41] Replaced setTag hack in Deserialize with @unionInit --- lib/std/io.zig | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/lib/std/io.zig b/lib/std/io.zig index 2c9c97131b..4407e6b2b3 100644 --- a/lib/std/io.zig +++ b/lib/std/io.zig @@ -1022,33 +1022,6 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing, return @bitCast(T, result); } - //@TODO: Replace this with @unionInit or whatever when it is added - // see: #1315 - fn setTag(ptr: var, tag: var) void { - const T = @typeOf(ptr); - comptime assert(trait.isPtrTo(builtin.TypeId.Union)(T)); - const U = meta.Child(T); - - const info = @typeInfo(U).Union; - if (info.tag_type) |TagType| { - comptime assert(TagType == @typeOf(tag)); - - var ptr_tag = ptr: { - if (@alignOf(TagType) >= @alignOf(U)) break :ptr @ptrCast(*TagType, ptr); - const offset = comptime max: { - var max_field_size: comptime_int = 0; - for (info.fields) |field_info| { - const field_size = @sizeOf(field_info.field_type); - max_field_size = math.max(max_field_size, field_size); - } - break :max math.max(max_field_size, @alignOf(U)); - }; - break :ptr @intToPtr(*TagType, @ptrToInt(ptr) + offset); - }; - ptr_tag.* = tag; - } - } - /// Deserializes and returns data of the specified type from the stream pub fn deserialize(self: *Self, comptime T: type) !T { var value: T = undefined; @@ -1111,18 +1084,12 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing, // safety. If it is bad, it will be caught anyway. const TagInt = @TagType(TagType); const tag = try self.deserializeInt(TagInt); - - { - @setRuntimeSafety(false); - //See: #1315 - setTag(ptr, @intToEnum(TagType, tag)); - } - + inline for (info.fields) |field_info| { if (field_info.enum_field.?.value == tag) { const name = field_info.name; const FieldType = field_info.field_type; - @field(ptr, name) = FieldType(undefined); + ptr.* = @unionInit(C, name, undefined); try self.deserializeInto(&@field(ptr, name)); return; } From 3e891c9c0be6873e036abb205230a6809ed94237 Mon Sep 17 00:00:00 2001 From: dtw-waleee Date: Mon, 14 Oct 2019 20:55:06 +0200 Subject: [PATCH 26/41] Fix keyboard layout issue with help-modal Some keyboard layouts produces a different ev.which value in firefox for ? than 191, eg. the Swedish QWERTY one produces 171. Chrome/chromium doesn't have this issue. --- lib/std/special/docs/main.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/std/special/docs/main.js b/lib/std/special/docs/main.js index 3650d46ec6..caa675167c 100644 --- a/lib/std/special/docs/main.js +++ b/lib/std/special/docs/main.js @@ -1210,9 +1210,20 @@ renderSearchCursor(); } + function getKeyValue(ev) { + if("key" in ev && typeof ev.key != "undefined") { + return ev.key + } + var code = ev.charCode || ev.keyCode; + if(code == 27) { + return "escape" + } + return String.fromCharCode(code) + } + function onWindowKeyDown(ev) { - switch (ev.which) { - case 27: + switch (getKeyValue(ev)) { + case "escape": if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; if (!domHelpModal.classList.contains("hidden")) { domHelpModal.classList.add("hidden"); @@ -1220,7 +1231,7 @@ ev.stopPropagation(); } break; - case 83: + case "s": if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; domSearch.focus(); domSearch.select(); @@ -1228,7 +1239,7 @@ ev.stopPropagation(); startAsyncSearch(); break; - case 191: + case "?": if (!ev.shiftKey || ev.ctrlKey || ev.altKey) return; ev.preventDefault(); ev.stopPropagation(); From 725c873e81460ce2b19bde98fae4473e4321c9fb Mon Sep 17 00:00:00 2001 From: dtw-waleee Date: Tue, 15 Oct 2019 19:35:53 +0200 Subject: [PATCH 27/41] fix small misstake, 'escape' v. 'Escape' --- lib/std/special/docs/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/special/docs/main.js b/lib/std/special/docs/main.js index caa675167c..409fc7322b 100644 --- a/lib/std/special/docs/main.js +++ b/lib/std/special/docs/main.js @@ -1216,14 +1216,14 @@ } var code = ev.charCode || ev.keyCode; if(code == 27) { - return "escape" + return "Escape" } return String.fromCharCode(code) } function onWindowKeyDown(ev) { switch (getKeyValue(ev)) { - case "escape": + case "Escape": if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; if (!domHelpModal.classList.contains("hidden")) { domHelpModal.classList.add("hidden"); From e6ca61bdd1031f13bd98bfe60bac6ef36f2cebbd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 15 Oct 2019 18:37:09 -0400 Subject: [PATCH 28/41] generated docs: further clean up keyboard shortcut handling now it's harder to introduce a bug when modifying keyboard shortcut code. --- lib/std/special/docs/main.js | 58 +++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/lib/std/special/docs/main.js b/lib/std/special/docs/main.js index 409fc7322b..58c956b3f1 100644 --- a/lib/std/special/docs/main.js +++ b/lib/std/special/docs/main.js @@ -1141,10 +1141,8 @@ } function onSearchKeyDown(ev) { - switch (ev.which) { - case 13: - if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; - + switch (getKeyString(ev)) { + case "Enter": // detect if this search changes anything var terms1 = getSearchTerms(); startSearch(); @@ -1157,9 +1155,7 @@ ev.preventDefault(); ev.stopPropagation(); return; - case 27: - if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; - + case "Esc": domSearch.value = ""; domSearch.blur(); curSearchIndex = -1; @@ -1167,16 +1163,12 @@ ev.stopPropagation(); startSearch(); return; - case 38: - if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; - + case "Up": moveSearchCursor(-1); ev.preventDefault(); ev.stopPropagation(); return; - case 40: - if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; - + case "Down": moveSearchCursor(1); ev.preventDefault(); ev.stopPropagation(); @@ -1210,21 +1202,35 @@ renderSearchCursor(); } - function getKeyValue(ev) { - if("key" in ev && typeof ev.key != "undefined") { - return ev.key - } - var code = ev.charCode || ev.keyCode; - if(code == 27) { - return "Escape" - } - return String.fromCharCode(code) + function getKeyString(ev) { + var name; + var ignoreShift = false; + switch (ev.which) { + case 13: + name = "Enter"; + break; + case 27: + name = "Esc"; + break; + case 38: + name = "Up"; + break; + case 40: + name = "Down"; + break; + default: + ignoreShift = true; + name = (ev.key != null) ? ev.key : String.fromCharCode(ev.charCode || ev.keyCode); + } + if (!ignoreShift && ev.shiftKey) name = "Shift+" + name; + if (ev.altKey) name = "Alt+" + name; + if (ev.ctrlKey) name = "Ctrl+" + name; + return name; } function onWindowKeyDown(ev) { - switch (getKeyValue(ev)) { - case "Escape": - if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; + switch (getKeyString(ev)) { + case "Esc": if (!domHelpModal.classList.contains("hidden")) { domHelpModal.classList.add("hidden"); ev.preventDefault(); @@ -1232,7 +1238,6 @@ } break; case "s": - if (ev.shiftKey || ev.ctrlKey || ev.altKey) return; domSearch.focus(); domSearch.select(); ev.preventDefault(); @@ -1240,7 +1245,6 @@ startAsyncSearch(); break; case "?": - if (!ev.shiftKey || ev.ctrlKey || ev.altKey) return; ev.preventDefault(); ev.stopPropagation(); showHelpModal(); From 47dfaf3d175ebea63b169a373b4dec4af6af7001 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 11 Oct 2019 18:36:00 -0400 Subject: [PATCH 29/41] merge analysis dumps tool handles errors --- tools/merge_anal_dumps.zig | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/tools/merge_anal_dumps.zig b/tools/merge_anal_dumps.zig index 53f9e438aa..23696506ae 100644 --- a/tools/merge_anal_dumps.zig +++ b/tools/merge_anal_dumps.zig @@ -46,6 +46,21 @@ const Node = struct { } }; +const Error = struct { + src: usize, + name: []const u8, + + fn hash(n: Error) u32 { + var hasher = std.hash.Wyhash.init(0); + std.hash.autoHash(&hasher, n.src); + return @truncate(u32, hasher.final()); + } + + fn eql(a: Error, b: Error) bool { + return a.src == b.src; + } +}; + const Dump = struct { zig_id: ?[]const u8 = null, zig_version: ?[]const u8 = null, @@ -60,6 +75,10 @@ const Dump = struct { node_list: std.ArrayList(Node), node_map: NodeMap, + const ErrorMap = std.HashMap(Error, usize, Error.hash, Error.eql); + error_list: std.ArrayList(Error), + error_map: ErrorMap, + fn init(allocator: *mem.Allocator) Dump { return Dump{ .targets = std.ArrayList([]const u8).init(allocator), @@ -67,6 +86,8 @@ const Dump = struct { .file_map = FileMap.init(allocator), .node_list = std.ArrayList(Node).init(allocator), .node_map = NodeMap.init(allocator), + .error_list = std.ArrayList(Error).init(allocator), + .error_map = ErrorMap.init(allocator), }; } @@ -129,6 +150,21 @@ const Dump = struct { } // Merge errors. If the AST Node matches, it's the same error value. + const other_errors = root.Object.get("errors").?.value.Array.toSliceConst(); + var other_error_to_mine = std.AutoHashMap(usize, usize).init(self.a()); + for (other_errors) |other_error_json, i| { + const other_src_id = jsonObjInt(other_error_json, "src"); + const other_error = Error{ + .src = other_ast_node_to_mine.getValue(other_src_id).?, + .name = other_error_json.Object.get("name").?.value.String, + }; + const gop = try self.error_map.getOrPut(other_error); + if (!gop.found_existing) { + gop.kv.value = self.error_list.len; + try self.error_list.append(other_error); + } + try other_error_to_mine.putNoClobber(i, gop.kv.value); + } } fn render(self: *Dump, stream: var) !void { @@ -168,6 +204,22 @@ const Dump = struct { try jw.endObject(); + try jw.objectField("errors"); + try jw.beginArray(); + for (self.error_list.toSliceConst()) |zig_error| { + try jw.arrayElem(); + try jw.beginObject(); + + try jw.objectField("src"); + try jw.emitNumber(zig_error.src); + + try jw.objectField("name"); + try jw.emitString(zig_error.name); + + try jw.endObject(); + } + try jw.endArray(); + try jw.objectField("astNodes"); try jw.beginArray(); for (self.node_list.toSliceConst()) |node| { From 1014cfdf3b60faf9af5b062d198f4f44976cb1bc Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 16 Oct 2019 01:29:16 -0400 Subject: [PATCH 30/41] generated docs: progress towards generic types being useful See #3406 --- lib/std/hash_map.zig | 3 +- lib/std/meta.zig | 10 ++ lib/std/special/docs/index.html | 15 +- lib/std/special/docs/main.js | 249 +++++++++++++++++++++++++++++--- src/dump_analysis.cpp | 170 +++++++++++++--------- tools/merge_anal_dumps.zig | 173 ++++++++++++++++++++++ 6 files changed, 531 insertions(+), 89 deletions(-) diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index 677dfe4435..7c872de5ca 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -36,7 +36,8 @@ pub fn HashMap(comptime K: type, comptime V: type, comptime hash: fn (key: K) u3 size: usize, max_distance_from_start_index: usize, allocator: *Allocator, - // this is used to detect bugs where a hashtable is edited while an iterator is running. + + /// This is used to detect bugs where a hashtable is edited while an iterator is running. modification_count: debug_u32, const Self = @This(); diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 52d8b54ecc..46018e0b1d 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -542,3 +542,13 @@ pub fn intToEnum(comptime Tag: type, tag_int: var) IntToEnumError!Tag { } return error.InvalidEnumTag; } + +/// Given a type and a name, return the field index according to source order. +/// Returns `null` if the field is not found. +pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int { + inline for (fields(T)) |field, i| { + if (mem.eql(u8, field.name, name)) + return comptime_int(i); + } + return null; +} diff --git a/lib/std/special/docs/index.html b/lib/std/special/docs/index.html index 83032d87da..bf71d6c04c 100644 --- a/lib/std/special/docs/index.html +++ b/lib/std/special/docs/index.html @@ -104,6 +104,16 @@ background-color: #FFBB4D; color: #000; } + #listFnExamples { + list-style-type: none; + margin: 0; + padding: 0; + } + #listFnExamples li { + padding: 0.5em 0; + white-space: nowrap; + overflow-x: auto; + } #logo { width: 8em; padding: 0.5em 1em; @@ -289,7 +299,6 @@

     
     

- @@ -357,6 +366,10 @@
+