mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-07 18:28:04 +03:00
0d4db8828a
We pass -MD -MF args to clang when doing `@cImport`, which gives us a complete list of files that the C code read from. Then we add these to the cache. So even when using `@cImport` Zig's caching system remains perfect. This is a proof of concept for the mechanism that the self-hosted compiler will use to watch and rebuild files.
51 lines
1008 B
C++
51 lines
1008 B
C++
/*
|
|
* Copyright (c) 2015 Andrew Kelley
|
|
*
|
|
* This file is part of zig, which is MIT licensed.
|
|
* See http://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#ifndef ERROR_HPP
|
|
#define ERROR_HPP
|
|
|
|
#include <assert.h>
|
|
|
|
enum Error {
|
|
ErrorNone,
|
|
ErrorNoMem,
|
|
ErrorInvalidFormat,
|
|
ErrorSemanticAnalyzeFail,
|
|
ErrorAccess,
|
|
ErrorInterrupted,
|
|
ErrorSystemResources,
|
|
ErrorFileNotFound,
|
|
ErrorFileSystem,
|
|
ErrorFileTooBig,
|
|
ErrorDivByZero,
|
|
ErrorOverflow,
|
|
ErrorPathAlreadyExists,
|
|
ErrorUnexpected,
|
|
ErrorExactDivRemainder,
|
|
ErrorNegativeDenominator,
|
|
ErrorShiftedOutOneBits,
|
|
ErrorCCompileErrors,
|
|
ErrorEndOfFile,
|
|
ErrorIsDir,
|
|
ErrorUnsupportedOperatingSystem,
|
|
ErrorSharingViolation,
|
|
ErrorPipeBusy,
|
|
ErrorPrimitiveTypeNotFound,
|
|
ErrorCacheUnavailable,
|
|
ErrorPathTooLong,
|
|
ErrorCCompilerCannotFindFile,
|
|
ErrorReadingDepFile,
|
|
};
|
|
|
|
const char *err_str(Error err);
|
|
|
|
static inline void assertNoError(Error err) {
|
|
assert(err == ErrorNone);
|
|
}
|
|
|
|
#endif
|