diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-11-17 02:18:56 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-11-17 02:18:56 -0500 |
| commit | c21884e1d64e4193e03be4f3064917a26b34b142 (patch) | |
| tree | 91e09e1df556e260ea2f1b171eaa05bd30646e1f /src/error.hpp | |
| parent | 2928b01afc5f0d84669ac6a70eedab4117d805f3 (diff) | |
| parent | 704374e51294e14285b0b54030c1cb6154868098 (diff) | |
| download | zig-c21884e1d64e4193e03be4f3064917a26b34b142.tar.gz zig-c21884e1d64e4193e03be4f3064917a26b34b142.zip | |
Merge remote-tracking branch 'origin/master' into llvm8
Diffstat (limited to 'src/error.hpp')
| -rw-r--r-- | src/error.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/error.hpp b/src/error.hpp index 0996a41d58..8b8fa5ce17 100644 --- a/src/error.hpp +++ b/src/error.hpp @@ -8,6 +8,8 @@ #ifndef ERROR_HPP #define ERROR_HPP +#include <assert.h> + enum Error { ErrorNone, ErrorNoMem, @@ -32,8 +34,13 @@ enum Error { ErrorUnsupportedOperatingSystem, ErrorSharingViolation, ErrorPipeBusy, + ErrorPrimitiveTypeNotFound, }; -const char *err_str(int err); +const char *err_str(Error err); + +static inline void assertNoError(Error err) { + assert(err == ErrorNone); +} #endif |
