# HG changeset patch # User Bruno Haible # Date 1548706448 -3600 # Node ID b973ad598121314e354eec01108062852c46c27a # Parent b89f4c4417672425b91ee68e7c73f2015990eaa8 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. diff -r b89f4c441767 -r b973ad598121 ChangeLog --- a/ChangeLog Mon Jan 28 01:20:11 2019 +0100 +++ b/ChangeLog Mon Jan 28 21:14:08 2019 +0100 @@ -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 -r b89f4c441767 -r b973ad598121 tests/uninorm/test-nfc.c --- a/tests/uninorm/test-nfc.c Mon Jan 28 01:20:11 2019 +0100 +++ b/tests/uninorm/test-nfc.c Mon Jan 28 21:14:08 2019 +0100 @@ -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 @@ 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 -r b89f4c441767 -r b973ad598121 tests/uninorm/test-nfd.c --- a/tests/uninorm/test-nfd.c Mon Jan 28 01:20:11 2019 +0100 +++ b/tests/uninorm/test-nfd.c Mon Jan 28 21:14:08 2019 +0100 @@ -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 @@ 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 -r b89f4c441767 -r b973ad598121 tests/uninorm/test-nfkc.c --- a/tests/uninorm/test-nfkc.c Mon Jan 28 01:20:11 2019 +0100 +++ b/tests/uninorm/test-nfkc.c Mon Jan 28 21:14:08 2019 +0100 @@ -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 @@ 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 -r b89f4c441767 -r b973ad598121 tests/uninorm/test-nfkd.c --- a/tests/uninorm/test-nfkd.c Mon Jan 28 01:20:11 2019 +0100 +++ b/tests/uninorm/test-nfkd.c Mon Jan 28 21:14:08 2019 +0100 @@ -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 @@ 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 ();