hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

abort.ha (414B)


      1 // License: MPL-2.0
      2 // (c) 2021 Drew DeVault <sir@cmpwn.com>
      3 
      4 fn platform_abort(msg: str) void = {
      5 	const prefix = "Abort: ";
      6 	const linefeed = "\n";
      7 	write(STDERR_FILENO, *(&prefix: **void): *const char, len(prefix)): void;
      8 	write(STDERR_FILENO, *(&msg: **void): *const char, len(msg)): void;
      9 	write(STDERR_FILENO, *(&linefeed: **void): *const char, 1): void;
     10 	kill(getpid(), SIGABRT): void;
     11 	for (true) void;
     12 };