4 ms·
This builds with gcc 4.8.2 (and earlier), since gcc stdlib has definition for min/max functions. But for clang you need to include MIN function/macro based on y
by super_mario 13y ago
This builds with gcc 4.8.2 (and earlier), since gcc stdlib has definition for min/max functions. But for clang you need to include MIN function/macro based on your system type (hxindex.c does not link without it).
Specifically on Mac OS X you need to modify the hxindex.c like this:
--- hxindex.c 2013-07-25 17:22:53.000000000 -0400
+++ hxindex.c.patched 2014-03-11 10:05:55.000000000 -0400
@@ -43,6 +43,7 @@
* Version: $Id: hxindex.c,v 1.20 2013-07-25 21:04:05 bbos Exp $
*
**/
+#include <sys/param.h>
#include "config.h"
#include <assert.h>
#include <locale.h>
@@ -439,7 +440,7 @@
/* Count how many subterms are equal to the previous entry */
i = 0;
- while (i < min(term->nrkeys, globalprevious->nrkeys) &&
+ while (i < MIN(term->nrkeys, globalprevious->nrkeys) &&
!folding_cmp(term->sortkeys + i, 1, globalprevious->sortkeys + i, 1))
i++;
Basically, you need the sys/param.h include and change the min function calls to MIN.
- RBerenguel 13y agoHmmm weird, I can't compile on Mac OS (clang,) complains about undefined iofuncs in openurl. Can't figure out what it is exactly missing: seems to be a library, but where and why? I could install the Homebrew version, but it seems to have a bug that makes hxselect not work correctly :/
- gkya 13y agoI think the only dependency is curl.
- RBerenguel 13y agoThat's also the impression I got from the sources, and I have libcurl. I'm quite puzzled at where the problem is coming from. Just did a system upgrade (I was a minor release of Mac OS behind) and a brew update and upgrade and I'm still missing this minor "something." Oh well, the only thing that does not work correctly is hxselect... I just faked it with grep.
- k6hkUZtLUM 13y ago$ brew install -g html-xml-utils seems to work on OS X 10.9.2
- RBerenguel 13y agoThat's version 6.4, whereas the most recent is 6.6
- gkya 13y agoAFAIK MIN macro is not standard (not sure though), so I made this: --- hxindex.c.orig 2014-03-11 17:55:17.305697689 +0200 +++ hxindex.c 2014-03-11 17:58:30.331318646 +0200 @@ -103,6 +103,10 @@ #define SECNO "secno" /* Class of elements that define section # */ #define NO_NUM "no-num" /* Class of elements without a section # */ +#ifndef MIN +# define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) +#endif + typedef struct _indexterm { string url; int importance; /* 1 (low) or 2 (high) */ @@ -435,7 +439,7 @@ /* Count how many subterms are equal to the previous entry */ i = 0; - while (i < min(term->nrkeys, globalprevious->nrkeys) && + while (i < MIN(term->nrkeys, globalprevious->nrkeys) && !folding_cmp(term->sortkeys + i, 1, globalprevious->sortkeys + i, 1)) i++; I also created an Arch package with this patch: > https://dl.dropboxusercontent.com/u/127354948/arch-repo/html-xml-utils-6.6-1-x86_64.pkg.tar.xz https://dl.dropboxusercontent.com/u/127354948/arch-repo/html...