From a5988c12c1a8904bfa6c44a793fbe79fd9252021 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 28 Jan 2019 21:14:08 +0100 Subject: [PATCH] Fix build error when building a shared libunistring on Android. * tests/uninorm/test-nfc.c (n): Don't define on Android. (main): Add 'volatile', to defeat a GCC optimization that would eliminate the reference. * tests/uninorm/test-nfd.c (n): Don't define on Android. (main): Add 'volatile', to defeat a GCC optimization that would eliminate the reference. * tests/uninorm/test-nfkc.c (n): Don't define on Android. (main): Add 'volatile', to defeat a GCC optimization that would eliminate the reference. * tests/uninorm/test-nfkd.c (n): Don't define on Android. (main): Add 'volatile', to defeat a GCC optimization that would eliminate the reference. --- ChangeLog | 16 ++++++++++++++++ tests/uninorm/test-nfc.c | 4 ++-- tests/uninorm/test-nfd.c | 4 ++-- tests/uninorm/test-nfkc.c | 4 ++-- tests/uninorm/test-nfkd.c | 4 ++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1c1ae90d2..89904c0738 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2019-01-28 Bruno Haible + + Fix build error when building a shared libunistring on Android. + * tests/uninorm/test-nfc.c (n): Don't define on Android. + (main): Add 'volatile', to defeat a GCC optimization that would + eliminate the reference. + * tests/uninorm/test-nfd.c (n): Don't define on Android. + (main): Add 'volatile', to defeat a GCC optimization that would + eliminate the reference. + * tests/uninorm/test-nfkc.c (n): Don't define on Android. + (main): Add 'volatile', to defeat a GCC optimization that would + eliminate the reference. + * tests/uninorm/test-nfkd.c (n): Don't define on Android. + (main): Add 'volatile', to defeat a GCC optimization that would + eliminate the reference. + 2019-01-27 Bruno Haible Avoid build errors due to wrong references between modules. diff --git a/tests/uninorm/test-nfc.c b/tests/uninorm/test-nfc.c index b5c4a01a91..1bda462d35 100644 --- a/tests/uninorm/test-nfc.c +++ b/tests/uninorm/test-nfc.c @@ -20,7 +20,7 @@ #include "uninorm.h" -#if !WOE32DLL +#if !(WOE32DLL || defined __ANDROID__) /* Check that UNINORM_NFC is defined and links. */ uninorm_t n = UNINORM_NFC; #endif @@ -33,7 +33,7 @@ int main () { /* Check that UNINORM_NFC is defined and links. */ - uninorm_t nf = UNINORM_NFC; + volatile uninorm_t nf = UNINORM_NFC; (void) nf; test_u32_nfc (); diff --git a/tests/uninorm/test-nfd.c b/tests/uninorm/test-nfd.c index bcb2d02fe1..e2e8b62c07 100644 --- a/tests/uninorm/test-nfd.c +++ b/tests/uninorm/test-nfd.c @@ -20,7 +20,7 @@ #include "uninorm.h" -#if !WOE32DLL +#if !(WOE32DLL || defined __ANDROID__) /* Check that UNINORM_NFD is defined and links. */ uninorm_t n = UNINORM_NFD; #endif @@ -33,7 +33,7 @@ int main () { /* Check that UNINORM_NFD is defined and links. */ - uninorm_t nf = UNINORM_NFD; + volatile uninorm_t nf = UNINORM_NFD; (void) nf; test_u32_nfd (); diff --git a/tests/uninorm/test-nfkc.c b/tests/uninorm/test-nfkc.c index 6df038d8be..7e76fbb95f 100644 --- a/tests/uninorm/test-nfkc.c +++ b/tests/uninorm/test-nfkc.c @@ -20,7 +20,7 @@ #include "uninorm.h" -#if !WOE32DLL +#if !(WOE32DLL || defined __ANDROID__) /* Check that UNINORM_NFKC is defined and links. */ uninorm_t n = UNINORM_NFKC; #endif @@ -33,7 +33,7 @@ int main () { /* Check that UNINORM_NFKC is defined and links. */ - uninorm_t nf = UNINORM_NFKC; + volatile uninorm_t nf = UNINORM_NFKC; (void) nf; test_u32_nfkc (); diff --git a/tests/uninorm/test-nfkd.c b/tests/uninorm/test-nfkd.c index ad89e2e34b..501630c583 100644 --- a/tests/uninorm/test-nfkd.c +++ b/tests/uninorm/test-nfkd.c @@ -20,7 +20,7 @@ #include "uninorm.h" -#if !WOE32DLL +#if !(WOE32DLL || defined __ANDROID__) /* Check that UNINORM_NFKD is defined and links. */ uninorm_t n = UNINORM_NFKD; #endif @@ -33,7 +33,7 @@ int main () { /* Check that UNINORM_NFKD is defined and links. */ - uninorm_t nf = UNINORM_NFKD; + volatile uninorm_t nf = UNINORM_NFKD; (void) nf; test_u32_nfkd (); -- 2.39.5