mirror of
https://github.com/ziglang/zig.git
synced 2025-12-20 21:23:06 +00:00
* libc_installation.cpp is deleted. src-self-hosted/libc_installation.zig is now used for both stage1 and stage2 compilers. * (breaking) move `std.fs.File.access` to `std.fs.Dir.access`. The API now encourages use with an open directory handle. * Add `std.os.faccessat` and related functions. * Deprecate the "C" suffix naming convention for null-terminated parameters. "C" should be used when it is related to libc. However null-terminated parameters often have to do with the native system ABI rather than libc. "Z" suffix is the new convention. For example, `std.os.openC` is deprecated in favor of `std.os.openZ`. * Add `std.mem.dupeZ` for using an allocator to copy memory and add a null terminator. * Remove dead struct field `std.ChildProcess.llnode`. * Introduce `std.event.Batch`. This API allows expressing concurrency without forcing code to be async. It requires no Allocator and does not introduce any failure conditions. However it is not thread-safe. * There is now an ongoing experiment to transition away from `std.event.Group` in favor of `std.event.Batch`. * `std.os.execvpeC` calls `getenvZ` rather than `getenv`. This is slightly more efficient on most systems, and works around a limitation of `getenv` lack of integration with libc. * (breaking) `std.os.AccessError` gains `FileBusy`, `SymLinkLoop`, and `ReadOnlyFileSystem`. Previously these error codes were all reported as `PermissionDenied`. * Add `std.Target.isDragonFlyBSD`. * stage2: access to the windows_sdk functions is done with a manually maintained .zig binding file instead of `@cImport`. * Update src-self-hosted/libc_installation.zig with all the improvements that stage1 has seen to src/libc_installation.cpp until now. In addition, it now takes advantage of Batch so that evented I/O mode takes advantage of concurrency, but it still works in blocking I/O mode, which is how it is used in stage1.
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
/*
|
|
* Copyright (c) 2018 Andrew Kelley
|
|
*
|
|
* This file is part of zig, which is MIT licensed.
|
|
* See http://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#ifndef ZIG_WINDOWS_SDK_H
|
|
#define ZIG_WINDOWS_SDK_H
|
|
|
|
#ifdef __cplusplus
|
|
#define ZIG_EXTERN_C extern "C"
|
|
#else
|
|
#define ZIG_EXTERN_C
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
|
|
// ABI warning - src-self-hosted/windows_sdk.zig
|
|
struct ZigWindowsSDK {
|
|
const char *path10_ptr;
|
|
size_t path10_len;
|
|
|
|
const char *version10_ptr;
|
|
size_t version10_len;
|
|
|
|
const char *path81_ptr;
|
|
size_t path81_len;
|
|
|
|
const char *version81_ptr;
|
|
size_t version81_len;
|
|
|
|
const char *msvc_lib_dir_ptr;
|
|
size_t msvc_lib_dir_len;
|
|
};
|
|
|
|
// ABI warning - src-self-hosted/windows_sdk.zig
|
|
enum ZigFindWindowsSdkError {
|
|
ZigFindWindowsSdkErrorNone,
|
|
ZigFindWindowsSdkErrorOutOfMemory,
|
|
ZigFindWindowsSdkErrorNotFound,
|
|
ZigFindWindowsSdkErrorPathTooLong,
|
|
};
|
|
|
|
// ABI warning - src-self-hosted/windows_sdk.zig
|
|
ZIG_EXTERN_C enum ZigFindWindowsSdkError zig_find_windows_sdk(struct ZigWindowsSDK **out_sdk);
|
|
|
|
// ABI warning - src-self-hosted/windows_sdk.zig
|
|
ZIG_EXTERN_C void zig_free_windows_sdk(struct ZigWindowsSDK *sdk);
|
|
|
|
#endif
|