summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-03-23 15:28:46 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-23 15:28:47 +0000
commit8bed4516c2c7e71a0ad33e46d1524c8d232785df (patch)
tree14e73551d6bb7146615ec9abfcd4f3afd9c1a3b6 /luni
parent349ff40bf36c234d2333fc780fc83efda99f6ef9 (diff)
parent8046f4dbe122ac5f362693550360b54cd6943a4b (diff)
downloadlibcore-8bed4516c2c7e71a0ad33e46d1524c8d232785df.zip
libcore-8bed4516c2c7e71a0ad33e46d1524c8d232785df.tar.gz
libcore-8bed4516c2c7e71a0ad33e46d1524c8d232785df.tar.bz2
Merge "Use compiler pragmas instead of flags."
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/native/libcore_icu_NativeIDN.cpp9
-rw-r--r--luni/src/main/native/sub.mk3
2 files changed, 9 insertions, 3 deletions
diff --git a/luni/src/main/native/libcore_icu_NativeIDN.cpp b/luni/src/main/native/libcore_icu_NativeIDN.cpp
index 16a6e1c..43f3ce5 100644
--- a/luni/src/main/native/libcore_icu_NativeIDN.cpp
+++ b/luni/src/main/native/libcore_icu_NativeIDN.cpp
@@ -39,9 +39,18 @@ static jstring NativeIDN_convertImpl(JNIEnv* env, jclass, jstring javaSrc, jint
}
UChar dst[256];
UErrorCode status = U_ZERO_ERROR;
+
+ // We're stuck implementing IDNA-2003 for now since that's what we specify.
+ //
+ // TODO: Change our spec to IDNA-2008 + UTS-46 compatibility processing if
+ // it's safe enough.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
size_t resultLength = toAscii
? uidna_IDNToASCII(src.get(), src.size(), &dst[0], sizeof(dst), flags, NULL, &status)
: uidna_IDNToUnicode(src.get(), src.size(), &dst[0], sizeof(dst), flags, NULL, &status);
+#pragma GCC diagnostic pop
+
if (U_FAILURE(status)) {
jniThrowException(env, "java/lang/IllegalArgumentException", u_errorName(status));
return NULL;
diff --git a/luni/src/main/native/sub.mk b/luni/src/main/native/sub.mk
index cf2118a..da866a6 100644
--- a/luni/src/main/native/sub.mk
+++ b/luni/src/main/native/sub.mk
@@ -64,6 +64,3 @@ LOCAL_STATIC_LIBRARIES += \
LOCAL_SHARED_LIBRARIES += \
liblog \
libnativehelper \
-
-# Workaround to let libcore_icu_NativeIDN.cpp use the deprecated IDNA2003 API:
-LOCAL_CFLAGS += -Wno-deprecated-declarations