]> git.lizzy.rs Git - uwu-lang.git/blobdiff - common/err.h
Unify error messages and checking
[uwu-lang.git] / common / err.h
index 34620bb8835d13325fa912acea1c183d1555c8d8..b9faf117dc1b81fc799c93fb7277069b96ee3c8b 100644 (file)
@@ -14,4 +14,14 @@ static inline void error(const char *format, ...)
        exit(1);
 }
 
+static inline void syserror(const char *call, FILE *file)
+{
+       perror(call);
+
+       if (file)
+               fclose(file);
+
+       exit(1);
+}
+
 #endif