Always use the compat functions
This commit is contained in:
parent
2809fd3795
commit
bd854ac71f
5
Makefile
5
Makefile
|
@ -21,6 +21,11 @@ DOC = \
|
||||||
TODO
|
TODO
|
||||||
HDR = compat.h
|
HDR = compat.h
|
||||||
|
|
||||||
|
COMPATOBJ = \
|
||||||
|
reallocarray.o\
|
||||||
|
strlcat.o\
|
||||||
|
strlcpy.o
|
||||||
|
|
||||||
OBJ = ${SRC:.c=.o} ${COMPATOBJ}
|
OBJ = ${SRC:.c=.o} ${COMPATOBJ}
|
||||||
|
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
|
|
2
compat.h
2
compat.h
|
@ -1,8 +1,6 @@
|
||||||
#ifdef COMPAT
|
|
||||||
#undef strlcat
|
#undef strlcat
|
||||||
size_t strlcat(char *, const char *, size_t);
|
size_t strlcat(char *, const char *, size_t);
|
||||||
#undef strlcpy
|
#undef strlcpy
|
||||||
size_t strlcpy(char *, const char *, size_t);
|
size_t strlcpy(char *, const char *, size_t);
|
||||||
#undef reallocarray
|
#undef reallocarray
|
||||||
void *reallocarray(void *, size_t, size_t);
|
void *reallocarray(void *, size_t, size_t);
|
||||||
#endif
|
|
||||||
|
|
|
@ -26,10 +26,5 @@ LDFLAGS = ${LIBS}
|
||||||
# -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_BSD_SOURCE ${INCS}
|
# -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_BSD_SOURCE ${INCS}
|
||||||
#LDFLAGS = -static -s ${LIBS}
|
#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
|
# compiler and linker
|
||||||
#CC = cc
|
#CC = cc
|
||||||
|
|
Loading…
Reference in a new issue