summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-01-31 15:27:53 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-01-31 15:27:53 +0100
commitfa635cfc925a95fe5c84569b043866dc3482ce90 (patch)
tree02e4a9a3024730b4387783b45ae66fdbe42477ac
parent4b3f099a01635e99e1112c56906ae337c1bb0ba9 (diff)
always add strlcpy, strlcat, remove COMPAT #ifdef
The overhead for OpenBSD is minimal. I will periodically sync from OpenBSD libc.
-rw-r--r--Makefile6
-rw-r--r--compat.h6
-rw-r--r--config.mk7
-rw-r--r--util.h5
4 files changed, 7 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 26e7835..2c8f6e2 100644
--- a/Makefile
+++ b/Makefile
@@ -12,8 +12,7 @@ SRC = \
sfeed_web.c\
sfeed_xmlenc.c\
util.c\
- xml.c
-COMPATSRC = \
+ xml.c\
strlcat.c\
strlcpy.c
BIN = \
@@ -48,11 +47,10 @@ DOC = \
README.xml\
TODO
HDR = \
- compat.h\
util.h\
xml.h
-OBJ = ${SRC:.c=.o} ${EXTRAOBJ}
+OBJ = ${SRC:.c=.o}
all: $(BIN)
diff --git a/compat.h b/compat.h
deleted file mode 100644
index 0947de6..0000000
--- a/compat.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifdef COMPAT
-#undef strlcat
-size_t strlcat(char *, const char *, size_t);
-#undef strlcpy
-size_t strlcpy(char *, const char *, size_t);
-#endif
diff --git a/config.mk b/config.mk
index ecf8b46..b56d6dc 100644
--- a/config.mk
+++ b/config.mk
@@ -2,7 +2,7 @@
# paths
PREFIX = /usr/local
-MANPREFIX = ${PREFIX}/share/man
+MANPREFIX = ${PREFIX}/man
# includes and libs
LIBS = -lc
@@ -22,10 +22,5 @@ LDFLAGS = -s ${LIBS}
# -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
#LDFLAGS = -static -s ${LIBS}
-# uncomment for compat
-CFLAGS += -DCOMPAT
-# uncomment if your libc doesn't support strlcat, strlcpy and strtonum.
-EXTRAOBJ = strlcat.o strlcpy.o
-
# compiler and linker
#CC = cc
diff --git a/util.h b/util.h
index 2e55460..29ba1ef 100644
--- a/util.h
+++ b/util.h
@@ -1,4 +1,7 @@
-#include "compat.h"
+#undef strlcat
+size_t strlcat(char *, const char *, size_t);
+#undef strlcpy
+size_t strlcpy(char *, const char *, size_t);
#define ISUTF8(c) (((c) & 0xc0) != 0x80)
#define LEN(x) (sizeof (x) / sizeof *(x))