view lphobos/internal/contract.d @ 1094:fa20521cbb13

Change faulty offset for asm in Cache.d (ie. change "-20(%rbp)+4)" to "4+-20(%rbp)")
author Kelly Wilson <wilsonk cpsc.ucalgary.ca>
date Wed, 11 Mar 2009 00:08:45 -0400
parents 373489eeaf90
children
line wrap: on
line source

module internal.contract;

import std.string: toString;
extern(C):

void exit(int);

/*void _d_assert(bool cond, uint line, char[] msg)
{
    if (!cond) {
        printf("Aborted(%u): %.*s\n", line, msg.length, msg.ptr);
        exit(1);
    }
}*/
void _d_assert(string file, uint line) {
  throw new Exception(file~":"~.toString(line)~": Assertion failed!");
}

void _d_assert_msg(string msg, string file, uint line) {
  throw new Exception(file~": "~.toString(line)~": Assertion failed: \""~msg~"\"");
}