Skip to content

Commit c984842

Browse files
committed
Patch sqlite.c in prepare_release.sh to remove compile time warnings
1 parent 6aa60dd commit c984842

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

prepare_release.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,15 @@ build_sqlcipher() {
4545
rm -f "$header_path" "$impl_path"
4646
mkdir -p "${sqlcipher_path}/include"
4747
cp -f "${tempdir}/sqlite3.h" "$header_path"
48-
cp -f "${tempdir}/sqlite3.c" "$impl_path"
48+
cp -f "${tempdir}/sqlite3.c" "${impl_path}.tmp"
49+
echo ""
50+
51+
# Including param.h unconditionally removes compile time
52+
# warnings about ambiguous MIN and MAX macros.
53+
printf '%s' "Patching sqlite.c ... "
54+
echo "#include <sys/param.h>" > "$impl_path"
55+
cat "${impl_path}.tmp" >> "$impl_path"
56+
rm -f "${impl_path}.tmp"
4957
echo ""
5058
}
5159

@@ -95,7 +103,6 @@ build_and_test_release() {
95103
swift test --skip "EncryptionTests.testSQLCipher3Compatibility"
96104

97105
echo ""
98-
echo "Building using release configuration ..."
99106
swift build -c release
100107

101108
cat <<- EOF
@@ -111,7 +118,8 @@ setup_new_release_branch() {
111118
local release_branch="release/${new_version}"
112119

113120
git checkout -b "$release_branch"
114-
git commit "$sqlcipher_path" -m "DuckDuckGo GRDB.swift ${new_version} (GRDB ${upstream-version}, SQLCipher ${sqlcipher_version})"
121+
git add "${cwd}/.github/README.md" "$sqlcipher_path"
122+
git commit -m "DuckDuckGo GRDB.swift ${new_version} (GRDB ${upstream-version}, SQLCipher ${sqlcipher_version})"
115123

116124
cat <<- EOF
117125

0 commit comments

Comments
 (0)