diff --git a/Makefile b/Makefile index 6d2929f..6be898f 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ OBJS= calmwm.o screen.o xmalloc.o client.o menu.o \ CPPFLAGS+= `pkg-config --cflags fontconfig x11 xft xinerama xrandr` CFLAGS?= -Wall -O2 -g -D_GNU_SOURCE +CFLAGS+= `[ "\`uname -s\`" = "Darwin" ] && echo "-DHAVE_STRLCPY -DHAVE_STRLCAT"` LDFLAGS+= `pkg-config --libs fontconfig x11 xft xinerama xrandr` diff --git a/calmwm.h b/calmwm.h index c2e0b90..4a652e3 100644 --- a/calmwm.h +++ b/calmwm.h @@ -24,8 +24,12 @@ /* prototypes for portable-included functions */ char *fgetln(FILE *, size_t *); long long strtonum(const char *, long long, long long, const char **); +#ifndef HAVE_STRLCPY size_t strlcpy(char *, const char *, size_t); +#endif +#ifndef HAVE_STRLCAT size_t strlcat(char *, const char *, size_t); +#endif #include #include