Always use the compat functions

This commit is contained in:
sin 2016-01-06 17:05:46 +00:00
parent 2809fd3795
commit bd854ac71f
3 changed files with 5 additions and 7 deletions

View File

@ -21,6 +21,11 @@ DOC = \
TODO
HDR = compat.h
COMPATOBJ = \
reallocarray.o\
strlcat.o\
strlcpy.o
OBJ = ${SRC:.c=.o} ${COMPATOBJ}
all: $(BIN)

View File

@ -1,8 +1,6 @@
#ifdef COMPAT
#undef strlcat
size_t strlcat(char *, const char *, size_t);
#undef strlcpy
size_t strlcpy(char *, const char *, size_t);
#undef reallocarray
void *reallocarray(void *, size_t, size_t);
#endif

View File

@ -26,10 +26,5 @@ LDFLAGS = ${LIBS}
# -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_BSD_SOURCE ${INCS}
#LDFLAGS = -static -s ${LIBS}
# uncomment for compat
CFLAGS += -DCOMPAT
# uncomment if your libc doesn't support reallocarray, strlcat, strlcpy.
COMPATOBJ = reallocarray.o strlcat.o strlcpy.o
# compiler and linker
#CC = cc