1 This patch removes htonll/ntohll substitution on platforms that already
3 We have upstream support ticket #12 to track the Solaris port, available
4 at: https://fedorahosted.org/mlocate/ticket/12
5 diff -rupN mlocate-0.25-clean/configure.ac mlocate-0.25/configure.ac
6 --- mlocate-0.25-clean/configure.ac 2012-03-03 04:58:54.000000000 +0000
7 +++ mlocate-0.25/configure.ac 2013-02-18 20:09:21.901723375 +0000
8 @@ -48,6 +48,8 @@ AM_GNU_GETTEXT_VERSION([0.17])
9 # Checks for library functions.
10 ## getopt_long () availability should be checked here
11 AC_CHECK_FUNCS_ONCE([fdopendir])
12 +AC_CHECK_FUNCS_ONCE([htonll])
13 +AC_CHECK_FUNCS_ONCE([ntohll])
16 # Checks for system services.
17 diff -rupN mlocate-0.25-clean/src/lib.c mlocate-0.25/src/lib.c
18 --- mlocate-0.25-clean/src/lib.c 2011-04-28 16:20:42.000000000 +0100
19 +++ mlocate-0.25/src/lib.c 2013-02-18 20:09:43.618165760 +0000
20 @@ -36,6 +36,7 @@ Author: Miloslav Trmac <mitr@redhat.com>
24 +#if !defined (HAVE_HTONLL)
25 /* Convert VAL to big endian */
28 @@ -50,7 +51,9 @@ htonll (uint64_t val)
29 memcpy ((unsigned char *)&ret + sizeof (high), &low, sizeof (low));
34 +#if !defined (HAVE_NTOHLL)
35 /* Convert VAL from big endian */
38 @@ -62,6 +65,7 @@ ntohll (uint64_t val)
39 memcpy (&low, (unsigned char *)&val + sizeof (high), sizeof (low));
40 return (uint64_t)ntohl (high) << 32 | ntohl (low);
44 /* A mapping table for dir_path_cmp: '\0' < '/' < anything else */
45 static unsigned char dir_path_cmp_table[UCHAR_MAX + 1];
46 diff -rupN mlocate-0.25-clean/src/lib.h mlocate-0.25/src/lib.h
47 --- mlocate-0.25-clean/src/lib.h 2011-03-29 22:59:00.000000000 +0100
48 +++ mlocate-0.25/src/lib.h 2013-02-18 20:09:43.619270168 +0000
49 @@ -41,11 +41,15 @@ Author: Miloslav Trmac <mitr@redhat.com>
50 /* Number of entries in ARRAY */
51 #define ARRAY_SIZE(array) (sizeof (array) / sizeof (*array))
53 +#if !defined (HAVE_HTONLL)
54 /* Convert VAL to big endian */
55 extern uint64_t htonll (uint64_t val);
58 +#if !defined (HAVE_NTOHLL)
59 /* Convert VAL from big endian */
60 extern uint64_t ntohll (uint64_t val);
63 /* Initialize dir_path_cmp_table */
64 extern void dir_path_cmp_init (void);