summaryrefslogtreecommitdiff
path: root/src/diff_exports.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff_exports.sh')
-rwxr-xr-xsrc/diff_exports.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/diff_exports.sh b/src/diff_exports.sh
new file mode 100755
index 0000000..7920f47
--- /dev/null
+++ b/src/diff_exports.sh
@@ -0,0 +1,23 @@
1#!/bin/bash -u
2
3# Copyright (c) 2018 Yubico AB. All rights reserved.
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file.
6
7[[ ! -f export.gnu || ! -f export.llvm || ! -f export.msvc ]] && exit 1
8
9TMPDIR=$(mktemp -d)
10GNU=${TMPDIR}/gnu
11LLVM=${TMPDIR}/llvm
12MSVC=${TMPDIR}/msvc
13
14egrep -o $'([^*{}\t]+);$' export.gnu | tr -d ';' | sort > ${GNU}
15sed 's/^_//g' export.llvm | sort > ${LLVM}
16egrep -v "^EXPORTS$" export.msvc | sort > ${MSVC}
17diff -u ${GNU} ${LLVM} && diff -u ${MSVC} ${LLVM}
18ERROR=$?
19
20rm ${GNU} ${LLVM} ${MSVC}
21rmdir ${TMPDIR}
22
23exit ${ERROR}