1 Star 0 Fork 10

yukai / hiviewdfx_hisysevent

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0000-adapt-for-build-c_utils.patch 4.48 KB
一键复制 编辑 原始数据 按行查看 历史
From 80f5c4618a582ac2735a770e5b6e2fc172a17f8e Mon Sep 17 00:00:00 2001
From: heppen <hepeng68@huawei.com>
Date: Tue, 20 Jun 2023 16:45:15 +0800
Subject: [PATCH] adapt for build
---
base/include/linux/ashmem.h | 44 +++++++++++++++++++++++++++++++++++++
base/src/event_reactor.h | 1 +
base/src/file_ex.cpp | 3 ++-
base/src/parcel.cpp | 1 +
base/src/string_ex.cpp | 2 ++
base/src/thread_pool.cpp | 1 +
6 files changed, 51 insertions(+), 1 deletion(-)
create mode 100644 base/include/linux/ashmem.h
diff --git a/base/include/linux/ashmem.h b/base/include/linux/ashmem.h
new file mode 100644
index 0000000..174667f
--- /dev/null
+++ b/base/include/linux/ashmem.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_ASHMEM_H
+#define _UAPI_LINUX_ASHMEM_H
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#define ASHMEM_NAME_LEN 256
+#define ASHMEM_NAME_DEF "dev/ashmem"
+#define ASHMEM_NOT_PURGED 0
+#define ASHMEM_WAS_PURGED 1
+#define ASHMEM_IS_UNPINNED 0
+#define ASHMEM_IS_PINNED 1
+struct ashmem_pin {
+ __u32 offset;
+ __u32 len;
+};
+#define __ASHMEMIOC 0x77
+#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
+#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
+#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
+#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
+#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long)
+#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6)
+#define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin)
+#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
+#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9)
+#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
+#endif
diff --git a/base/src/event_reactor.h b/base/src/event_reactor.h
index 794e44a..1a282ec 100644
--- a/base/src/event_reactor.h
+++ b/base/src/event_reactor.h
@@ -21,6 +21,7 @@
#include <memory>
#include <mutex>
#include <list>
+#include <functional>
namespace OHOS {
namespace Utils {
diff --git a/base/src/file_ex.cpp b/base/src/file_ex.cpp
index 578b1be..a9e0572 100644
--- a/base/src/file_ex.cpp
+++ b/base/src/file_ex.cpp
@@ -24,6 +24,7 @@
#include <cstdio>
#include <securec.h>
#include <cstring>
+#include <limits.h>
#include "directory_ex.h"
#include "utils_log.h"
@@ -262,7 +263,7 @@ bool SaveBufferToFile(const string& filePath, const vector<char>& content, bool
}
// if the file is not exist,create it first!
- uint32_t mode = truncated ? (ios::out | ios::binary | ios::trunc) : (ios::out | ios::binary | ios::app);
+ ios_base::openmode mode = truncated ? (ios::out | ios::binary | ios::trunc) : (ios::out | ios::binary | ios::app);
ofstream file;
file.open(filePath.c_str(), mode);
if (!file.is_open()) {
diff --git a/base/src/parcel.cpp b/base/src/parcel.cpp
index 4d62353..b0012bc 100644
--- a/base/src/parcel.cpp
+++ b/base/src/parcel.cpp
@@ -16,6 +16,7 @@
#include "parcel.h"
#include "securec.h"
#include "utils_log.h"
+#include <limits.h>
namespace OHOS {
diff --git a/base/src/string_ex.cpp b/base/src/string_ex.cpp
index 32340ae..782e419 100644
--- a/base/src/string_ex.cpp
+++ b/base/src/string_ex.cpp
@@ -20,6 +20,8 @@
#include <iostream>
#include <iomanip>
#include <sstream>
+#include <algorithm>
+#include <limits.h>
using namespace std;
namespace OHOS {
diff --git a/base/src/thread_pool.cpp b/base/src/thread_pool.cpp
index 9951929..b4e663c 100644
--- a/base/src/thread_pool.cpp
+++ b/base/src/thread_pool.cpp
@@ -19,6 +19,7 @@
#include <memory>
#include <pthread.h>
+#include <cstring>
namespace OHOS {
--
2.33.0
1
https://gitee.com/yukaii/hiviewdfx_hisysevent.git
git@gitee.com:yukaii/hiviewdfx_hisysevent.git
yukaii
hiviewdfx_hisysevent
hiviewdfx_hisysevent
master

搜索帮助