aboutsummaryrefslogblamecommitdiffhomepage
path: root/content/2022-05-30-cmake-cargo-example/calc.c
blob: 27ca0a9ce864baa3d6a5b93eae78cb0f6da2b2a1 (plain) (tree)


















                                     
#include <stdio.h>
#include <limits.h>

#include <libcalc.h>

#define EVAL(expr) \
    printf("%s = %d\n", #expr, expr);

int main() {
    EVAL(wrap_add(1,2));
    EVAL(wrap_add(INT_MAX,0));
    EVAL(wrap_add(INT_MAX,1));

    EVAL(sat_add(1,2));
    EVAL(sat_add(INT_MAX,0));
    EVAL(sat_add(INT_MAX,1));

    return 0;
}