aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2022-05-30-cmake-cargo-example/calc.c
blob: 27ca0a9ce864baa3d6a5b93eae78cb0f6da2b2a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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;
}