From d169850bafef052db4a33f9a452e655ac858c38b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 12 Oct 2017 15:37:46 -0700 Subject: Make iswblank a static inline. This way it won't affect anyone who's targeting a new enough API level. Bug: https://issuetracker.google.com/64451478 Test: python checkbuild.py Change-Id: I64ca915a4f2f7cc98242018fa191f084e321fbca --- sources/android/support/Android.mk | 1 - sources/android/support/include/wctype.h | 3 ++- sources/android/support/src/iswblank.cpp | 33 -------------------------------- 3 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 sources/android/support/src/iswblank.cpp (limited to 'sources') diff --git a/sources/android/support/Android.mk b/sources/android/support/Android.mk index d5479bf26..56315c61c 100644 --- a/sources/android/support/Android.mk +++ b/sources/android/support/Android.mk @@ -117,7 +117,6 @@ android_support_sources := \ $(BIONIC_PATH)/libm/upstream-freebsd/lib/msun/src/s_sin.c \ $(BIONIC_PATH)/libm/upstream-freebsd/lib/msun/src/s_tan.c \ $(BIONIC_PATH)/libm/upstream-freebsd/lib/msun/src/s_tanh.c \ - src/iswblank.cpp \ src/posix_memalign.cpp \ src/swprintf.cpp \ src/wcstox.cpp \ diff --git a/sources/android/support/include/wctype.h b/sources/android/support/include/wctype.h index 9801811a5..31d015d12 100644 --- a/sources/android/support/include/wctype.h +++ b/sources/android/support/include/wctype.h @@ -34,7 +34,8 @@ __BEGIN_DECLS #if __ANDROID_API__ < __ANDROID_API_L__ -int iswblank(wint_t); +#include +static __inline int iswblank(wint_t ch) { return isblank(ch); } #endif __END_DECLS diff --git a/sources/android/support/src/iswblank.cpp b/sources/android/support/src/iswblank.cpp deleted file mode 100644 index f51d1886a..000000000 --- a/sources/android/support/src/iswblank.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#include -#include - -int iswblank(wint_t ch) { - return isblank(ch); -} -- cgit v1.2.3