#ifndef LAYER1_RESULTS_H #define LAYER1_RESULTS_H typedef enum { OK, ERR_INVALID_STATE, ERR_NO_MEM, ERR_SIZE, ERR_LIQUID, } result_t; #ifdef DEBUG_LIQUID #include # define ERR_CHECK_LIQUID(call) \ do { \ liquid_error_code result; \ if((result = (call)) != LIQUID_OK) { \ fprintf(stderr, "Liquid call failed in %s:%d: %s\n", __FILE__, __LINE__, liquid_error_info(result)); \ return ERR_LIQUID; \ } \ } while(0); #else # define ERR_CHECK_LIQUID(call) if((call) != LIQUID_OK) { return ERR_LIQUID; } #endif #endif // LAYER1_RESULTS_H