diff options
| author | Chaosmaster <chaosmaster@chaosv.de> | 2020-02-05 23:28:55 +0100 |
|---|---|---|
| committer | nebrassy <nebras30@gmail.com> | 2020-04-26 11:52:56 +0200 |
| commit | 94fffebec7832b7b176f1852cb20f1c6106a7497 (patch) | |
| tree | e636fdb0f655ce8d3bdabcb2d02a42ed4b31d593 | |
| parent | f836b9f3f0dcab6f27602c27c7f7efe05a541b02 (diff) | |
magisk: make libresetprop compile with c++14
Change-Id: I9b36f86216142569361d297fad8008fb22a273eb
| -rw-r--r-- | Android.mk | 2 | ||||
| -rw-r--r-- | utils/file.cpp | 3 | ||||
| -rw-r--r-- | utils/files.h | 4 |
3 files changed, 5 insertions, 4 deletions
@@ -18,6 +18,6 @@ LIBXZ := $(EXT_PATH)/xz-embedded LIBPCRE2 := $(EXT_PATH)/pcre/include MAGISK_CFLAGS += -D__MVSTR="TWRP-dynamic" -D__MCODE="ed58cf9" -MAGISK_CFLAGS += -Wno-unused-parameter -std=c++17 -Wno-sign-compare +MAGISK_CFLAGS += -Wno-unused-parameter -std=c++14 -Wno-sign-compare include $(call all-subdir-makefiles) diff --git a/utils/file.cpp b/utils/file.cpp index 9af4365..efd9eb6 100644 --- a/utils/file.cpp +++ b/utils/file.cpp @@ -190,7 +190,8 @@ void clone_dir(int src, int dest, bool overwrite) { while ((entry = xreaddir(dir))) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) continue; - if (struct stat st; !overwrite && + struct stat st; + if (!overwrite && fstatat(dest, entry->d_name, &st, AT_SYMLINK_NOFOLLOW) == 0) continue; getattrat(src, entry->d_name, &a); diff --git a/utils/files.h b/utils/files.h index a53f632..7ec32ab 100644 --- a/utils/files.h +++ b/utils/files.h @@ -49,13 +49,13 @@ void parse_mnt(const char *file, const std::function<bool(mntent*)> &fn); template <typename T> void full_read(const char *filename, T &buf, size_t &size) { - static_assert(std::is_pointer<T>::value); + static_assert(std::is_pointer<T>::value, "msg"); full_read(filename, reinterpret_cast<void**>(&buf), &size); } template <typename T> void fd_full_read(int fd, T &buf, size_t &size) { - static_assert(std::is_pointer<T>::value); + static_assert(std::is_pointer<T>::value, "msg"); fd_full_read(fd, reinterpret_cast<void**>(&buf), &size); } |
