source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: let the build system cope with the recent ohash changes
Date: Thu, 19 Jun 2014 22:55:50 -0400 (EDT)	[thread overview]
Message-ID: <201406200255.s5K2too2031046@krisdoz.my.domain> (raw)

Log Message:
-----------
let the build system cope with the recent ohash changes

Modified Files:
--------------
    mdocml:
        Makefile
        configure
        test-ohash.c

Revision Data
-------------
Index: configure
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/configure,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lconfigure -Lconfigure -u -p -r1.3 -r1.4
--- configure
+++ configure
@@ -20,8 +20,8 @@ exec > config.h 2> config.log
 CFLAGS="${CFLAGS} -Wno-unused -Werror"
 
 runtest() {
-	echo ${CC} ${CFLAGS} -o test-${1} test-${1}.c 1>&2
-	${CC} ${CFLAGS} -o "test-${1}" "test-${1}.c" 1>&2 || return 0
+	echo ${CC} ${CFLAGS} ${3} -o test-${1} test-${1}.c 1>&2
+	${CC} ${CFLAGS} ${3} -o "test-${1}" "test-${1}.c" 1>&2 || return 0
 	"./test-${1}" && echo "#define HAVE_${2}" \
 		|| echo FAILURE: test-${1} returned $? 1>&2
 	rm "test-${1}"
@@ -33,7 +33,7 @@ echo "#define VERSION \"${VERSION}\""
 runtest fgetln FGETLN
 runtest getsubopt GETSUBOPT
 runtest mmap MMAP
-runtest ohash OHASH
+runtest ohash OHASH -lutil
 runtest reallocarray REALLOCARRAY
 runtest strcasestr STRCASESTR
 runtest strlcat STRLCAT
Index: Makefile
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/Makefile,v
retrieving revision 1.419
retrieving revision 1.420
diff -LMakefile -LMakefile -u -p -r1.419 -r1.420
--- Makefile
+++ Makefile
@@ -66,6 +66,10 @@ INSTALL_MAN	 = $(INSTALL_DATA)
 DBLIB		 = -L/usr/local/lib -lsqlite3
 DBBIN		 = makewhatis manpage apropos
 
+# OpenBSD has the ohash functions in libutil.
+# Comment the following line if your system doesn't.
+DBLIB		+= -lutil
+
 # === END OF USER SETTINGS =============================================
 
 ALLBIN		 = mandoc preconv demandoc $(DBBIN)
Index: test-ohash.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/test-ohash.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -Ltest-ohash.c -Ltest-ohash.c -u -p -r1.2 -r1.3
--- test-ohash.c
+++ test-ohash.c
@@ -3,16 +3,18 @@
 #include <stdlib.h>
 #include <ohash.h>
 
-void *xalloc(size_t sz, void *arg) { return(calloc(sz,1)); }
-void xfree(void *p, size_t sz, void *arg) { free(p); }
+void *xmalloc(size_t sz, void *arg) { return(calloc(1,sz)); }
+void *xcalloc(size_t nmemb, size_t sz, void *arg) { return(calloc(nmemb,sz)); }
+void xfree(void *p, void *arg) { free(p); }
 
 int
 main(void)
 {
 	struct ohash h;
 	struct ohash_info i;
-	i.halloc = i.alloc = xalloc;
-	i.hfree = xfree;
+	i.alloc = xmalloc;
+	i.calloc = xcalloc;
+	i.free = xfree;
 	ohash_init(&h, 2, &i);
 	ohash_delete(&h);
 	return 0;
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2014-06-20  2:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201406200255.s5K2too2031046@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).