
#ifndef PLS_ERROR_HANDLING_H
#define PLS_ERROR_HANDLING_H

#include <cstdio>
#include <cstdlib>

/**
 * Called when there is an non-recoverable error/invariant in the scheduler.
 * This SHOULD NOT HAPPEN AT ANY POINT in production, any instance of this is a bug!
 * The implementation can be changed if for example no iostream is available on a system
 * (or its inclusion adds too much overhead).
 */
#define PLS_ERROR(msg) printf("%s\n", msg); exit(1);

void pls_error(const char *msg);

// TODO: Distinguish between debug/internal asserts and production asserts.
#define PLS_ASSERT(cond, msg) // if (!(cond)) { pls_error(msg); }

#endif //PLS_ERROR_HANDLING_H
