Android: Enable C99 mode instead of C89 (default).
BUG=webrtc:4960 TESTED=Built locally using GYP and GN for Android. R=andrew@webrtc.org, brettw@chromium.org Review URL: https://codereview.webrtc.org/1321193003 . Cr-Commit-Position: refs/heads/master@{#9937}
This commit is contained in:
@ -154,14 +154,18 @@ config("common_config") {
|
||||
}
|
||||
|
||||
if (is_android && !is_clang) {
|
||||
# The Android NDK doesn"t provide optimized versions of these
|
||||
# functions. Ensure they are disabled for all compilers.
|
||||
cflags += [
|
||||
# The Android NDK doesn't provide optimized versions of these
|
||||
# functions. Ensure they are disabled for all compilers.
|
||||
"-fno-builtin-cos",
|
||||
"-fno-builtin-sin",
|
||||
"-fno-builtin-cosf",
|
||||
"-fno-builtin-sinf",
|
||||
]
|
||||
cflags_c = [
|
||||
# Use C99 mode instead of C89 (default).
|
||||
"-std=c99",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -373,14 +373,18 @@
|
||||
],
|
||||
'conditions': [
|
||||
['clang==0', {
|
||||
'cflags': [
|
||||
# The Android NDK doesn't provide optimized versions of these
|
||||
# functions. Ensure they are disabled for all compilers.
|
||||
'cflags': [
|
||||
'-fno-builtin-cos',
|
||||
'-fno-builtin-sin',
|
||||
'-fno-builtin-cosf',
|
||||
'-fno-builtin-sinf',
|
||||
],
|
||||
'cflags_c': [
|
||||
# Use C99 mode instead of C89 (default).
|
||||
'-std=c99',
|
||||
]
|
||||
}],
|
||||
],
|
||||
}],
|
||||
|
@ -22,9 +22,8 @@ void WebRtcIlbcfix_NearestNeighbor(size_t* index,
|
||||
const size_t* array,
|
||||
size_t value,
|
||||
size_t arlength) {
|
||||
size_t i;
|
||||
size_t min_diff = (size_t)-1;
|
||||
for (i = 0; i < arlength; i++) {
|
||||
for (size_t i = 0; i < arlength; i++) {
|
||||
const size_t diff =
|
||||
(array[i] < value) ? (value - array[i]) : (array[i] - value);
|
||||
if (diff < min_diff) {
|
||||
|
Reference in New Issue
Block a user