debug.hpp 304 B

1234567891011121314
  1. /*
  2. * Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
  3. */
  4. #pragma once
  5. #include <stdexcept>
  6. #ifndef STRINGIZE
  7. # define STRINGIZE2(x) #x
  8. # define STRINGIZE(x) STRINGIZE2(x)
  9. #endif
  10. #define ENFORCE(x) if (!(x)) { throw std::runtime_error(__FILE__ ":" STRINGIZE(__LINE__) ": " #x); }