summaryrefslogtreecommitdiffstats
path: root/libs/db/patches/040-sequence-type.patch
blob: 1d3b6f8e873bd95e533bfe028feacd3b674e5451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
configure wants to use host-specific types to get a 64-bit integer in db.h
instead of using an alias such as int64_t.  This means that the header differs
in multilib environments for no good reason, so replace the type with the alias
in stdint.h.

This then breaks the overly complicated type check but as we know that int64_t
exists and works, we can just delete that.

Upstream-Status: Inappropriate [as far as open source community is concerned, upstream is dead]
Signed-off-by: Ross Burton <ross.burton@intel.com>

--- a/dist/aclocal/sequence.m4
+++ b/dist/aclocal/sequence.m4
@@ -21,14 +21,14 @@ AC_DEFUN(AM_SEQUENCE_CONFIGURE, [
 	db_cv_seq_type="no"
 	if test "$db_cv_build_sequence" = "yes" -a\
 	    "$ac_cv_sizeof_long" -eq "8"; then
-		db_cv_seq_type="long"
+		db_cv_seq_type="int64_t"
 		db_cv_seq_fmt='"%ld"'
 		db_cv_seq_ufmt='"%lu"'
 		INT64_FMT='#define	INT64_FMT	"%ld"'
 		UINT64_FMT='#define	UINT64_FMT	"%lu"'
 	else if test "$db_cv_build_sequence" = "yes" -a\
 	    "$ac_cv_sizeof_long_long" -eq "8"; then
-		db_cv_seq_type="long long"
+		db_cv_seq_type="int64_t"
 		db_cv_seq_fmt='"%lld"'
 		db_cv_seq_ufmt='"%llu"'
 		INT64_FMT='#define	INT64_FMT	"%lld"'
@@ -38,44 +38,7 @@ AC_DEFUN(AM_SEQUENCE_CONFIGURE, [
 	fi
 	fi
 
-	# Test to see if we can declare variables of the appropriate size
-	# and format them.  If we're cross-compiling, all we get is a link
-	# test, which won't test for the appropriate printf format strings.
-	if test "$db_cv_build_sequence" = "yes"; then
-		AC_TRY_RUN([
-		main() {
-			$db_cv_seq_type l;
-			unsigned $db_cv_seq_type u;
-			char buf@<:@100@:>@;
-
-			buf@<:@0@:>@ = 'a';
-			l = 9223372036854775807LL;
-			(void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
-			if (strcmp(buf, "9223372036854775807"))
-				return (1);
-			u = 18446744073709551615ULL;
-			(void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
-			if (strcmp(buf, "18446744073709551615"))
-				return (1);
-			return (0);
-		}],, [db_cv_build_sequence="no"],
-		AC_TRY_LINK(,[
-			$db_cv_seq_type l;
-			unsigned $db_cv_seq_type u;
-			char buf@<:@100@:>@;
-
-			buf@<:@0@:>@ = 'a';
-			l = 9223372036854775807LL;
-			(void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
-			if (strcmp(buf, "9223372036854775807"))
-				return (1);
-			u = 18446744073709551615ULL;
-			(void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
-			if (strcmp(buf, "18446744073709551615"))
-				return (1);
-			return (0);
-		],, [db_cv_build_sequence="no"]))
-	fi
+	db_cv_build_sequence="yes"
 	if test "$db_cv_build_sequence" = "yes"; then
 		AC_SUBST(db_seq_decl)
 		db_seq_decl="typedef $db_cv_seq_type db_seq_t;";