diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-03-07 10:07:58 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-03-07 10:07:58 +0100 |
commit | 36ffb88a365ecf9943e5739acb923a36f77d0c21 (patch) | |
tree | eec97defc4958b044dd67469d7d72cfcd3386449 | |
parent | 5ecd0fc61a1a292426538fcb1e791342e04953b5 (diff) |
Minor tweaks
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | lib/alloc/bufalloc.c | 4 |
2 files changed, 14 insertions, 2 deletions
@@ -2,9 +2,19 @@ MAKEFLAGS = -j8 srcs := $(shell find . -name '*.c') objs := $(srcs:.c=.o) +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) +CC = gcc +CFLAGS = -std=c23 -Iinclude +endif +ifeq ($(UNAME_S),Darwin) +CC = gcc-13 +CFLAGS = -std=c2x -Iinclude +endif + all: $(objs) %.o: %.c - gcc-13 -std=c2x -Iinclude -c -o $@ $< + $(CC) $(CFLAGS) -c -o $@ $< clean: rm -f $(objs) diff --git a/lib/alloc/bufalloc.c b/lib/alloc/bufalloc.c index a81f5b9..dcb0a93 100644 --- a/lib/alloc/bufalloc.c +++ b/lib/alloc/bufalloc.c @@ -1,7 +1,9 @@ #include <errno.h> #if __has_include(<stdckdint.h>) # include <stdckdint.h> -# warning "stdckdint.h now available; remove manual ckd_*() implementations" +# ifdef __APPLE__ +# warning "stdckdint.h now available on Mac; remove manual ckd_*() code" +# endif #elifdef __GNUC__ # define ckd_add(r, a, b) ((bool)__builtin_add_overflow(a, b, r)) # define ckd_mul(r, a, b) ((bool)__builtin_mul_overflow(a, b, r)) |