view lphobos/internal/contract.d @ 993:27956b440c0a

Fixed const/invariant struc/class fields of the form const int i = 4; they don't add a field.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 26 Feb 2009 15:24:20 +0100
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~"\"");
}