From cc930e44058118d3f87bdc11fc8a1837d7d66b6f Mon Sep 17 00:00:00 2001 From: Mister Oyster Date: Sun, 7 Jan 2018 13:46:18 +0100 Subject: libshim: reorganize a bit --- libshims/Android.mk | 8 +++----- libshims/atomic.cpp | 21 --------------------- libshims/misc/atomic.cpp | 21 +++++++++++++++++++++ libshims/misc/mtk-lp-omx.cpp | 5 +++++ libshims/misc/xlog.c | 16 ++++++++++++++++ libshims/mtk-lp-omx.cpp | 5 ----- libshims/xlog.c | 16 ---------------- 7 files changed, 45 insertions(+), 47 deletions(-) delete mode 100644 libshims/atomic.cpp create mode 100644 libshims/misc/atomic.cpp create mode 100644 libshims/misc/mtk-lp-omx.cpp create mode 100644 libshims/misc/xlog.c delete mode 100644 libshims/mtk-lp-omx.cpp delete mode 100644 libshims/xlog.c diff --git a/libshims/Android.mk b/libshims/Android.mk index 3b99ea0..b5c764e 100644 --- a/libshims/Android.mk +++ b/libshims/Android.mk @@ -22,7 +22,7 @@ include $(BUILD_SHARED_LIBRARY) ## libshim_atomic include $(CLEAR_VARS) -LOCAL_SRC_FILES := atomic.cpp +LOCAL_SRC_FILES := misc/atomic.cpp LOCAL_MODULE := libshim_atomic LOCAL_MODULE_CLASS := SHARED_LIBRARIES LOCAL_CFLAGS := -O3 -Wno-unused-variable -Wno-unused-parameter @@ -32,7 +32,7 @@ include $(BUILD_SHARED_LIBRARY) ## libshim_omx include $(CLEAR_VARS) -LOCAL_SRC_FILES := mtk-lp-omx.cpp +LOCAL_SRC_FILES := misc/mtk-lp-omx.cpp LOCAL_MODULE := libshim_omx LOCAL_CFLAGS := -O3 -Wno-unused-variable -Wno-unused-parameter LOCAL_PROPRIETARY_MODULE := true @@ -44,8 +44,6 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := ui/mtk_ui.cpp -#ui/mtk_gbc1.cpp - LOCAL_SHARED_LIBRARIES := \ libbinder \ libui @@ -95,7 +93,7 @@ include $(BUILD_SHARED_LIBRARY) ## libshim_xlog include $(CLEAR_VARS) -LOCAL_SRC_FILES := xlog.c +LOCAL_SRC_FILES := misc/xlog.c LOCAL_SHARED_LIBRARIES := liblog LOCAL_MODULE := libshim_xlog diff --git a/libshims/atomic.cpp b/libshims/atomic.cpp deleted file mode 100644 index 3a159e2..0000000 --- a/libshims/atomic.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2017 The LineageOS Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#define ANDROID_ATOMIC_INLINE -extern "C" { -#include -} diff --git a/libshims/misc/atomic.cpp b/libshims/misc/atomic.cpp new file mode 100644 index 0000000..3a159e2 --- /dev/null +++ b/libshims/misc/atomic.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2017 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#define ANDROID_ATOMIC_INLINE +extern "C" { +#include +} diff --git a/libshims/misc/mtk-lp-omx.cpp b/libshims/misc/mtk-lp-omx.cpp new file mode 100644 index 0000000..099be12 --- /dev/null +++ b/libshims/misc/mtk-lp-omx.cpp @@ -0,0 +1,5 @@ +extern "C" { + void _ZN7android13AwesomePlayer24mtk_omx_get_current_timeEPx(long long* time){ + time = (long long*)-1; + } +} diff --git a/libshims/misc/xlog.c b/libshims/misc/xlog.c new file mode 100644 index 0000000..59a2afd --- /dev/null +++ b/libshims/misc/xlog.c @@ -0,0 +1,16 @@ +#include + +struct xlog_record { + const char *tag_str; + const char *fmt_str; + int prio; +}; + +void __attribute__((weak)) __xlog_buf_printf(__unused int bufid, const struct xlog_record *xlog_record, ...) { + va_list args; + va_start(args, xlog_record); + + __android_log_vprint(xlog_record->prio, xlog_record->tag_str, xlog_record->fmt_str, args); + + return; +} diff --git a/libshims/mtk-lp-omx.cpp b/libshims/mtk-lp-omx.cpp deleted file mode 100644 index 099be12..0000000 --- a/libshims/mtk-lp-omx.cpp +++ /dev/null @@ -1,5 +0,0 @@ -extern "C" { - void _ZN7android13AwesomePlayer24mtk_omx_get_current_timeEPx(long long* time){ - time = (long long*)-1; - } -} diff --git a/libshims/xlog.c b/libshims/xlog.c deleted file mode 100644 index 59a2afd..0000000 --- a/libshims/xlog.c +++ /dev/null @@ -1,16 +0,0 @@ -#include - -struct xlog_record { - const char *tag_str; - const char *fmt_str; - int prio; -}; - -void __attribute__((weak)) __xlog_buf_printf(__unused int bufid, const struct xlog_record *xlog_record, ...) { - va_list args; - va_start(args, xlog_record); - - __android_log_vprint(xlog_record->prio, xlog_record->tag_str, xlog_record->fmt_str, args); - - return; -} -- cgit v1.2.3