Bugfix for libportable to make compile happy.
Just a tricky issue.
WRAP(stat) -> stat_portable, However we have a struct naming stat_portable.
Let's just rename it.
Change-Id: If0a33661d9d23750d4af45158d1336bb71a08cab
diff --git a/ndk/sources/android/libportable/common/include/fenv_portable.h b/ndk/sources/android/libportable/common/include/fenv_portable.h
index 04d9dcb..97a2876 100644
--- a/ndk/sources/android/libportable/common/include/fenv_portable.h
+++ b/ndk/sources/android/libportable/common/include/fenv_portable.h
@@ -169,7 +169,7 @@
}
int WRAP(feholdexcept)(fenv_t_portable* __envp) {
- memset(__envp, '\0', sizeof(__envp));
+ memset(__envp, '\0', sizeof(fenv_t_portable));
fenv_t env;
int ret = REAL(feholdexcept)(&env);
memcpy(__envp, &env, sizeof(env));
diff --git a/ndk/sources/android/libportable/common/include/stat_portable.h b/ndk/sources/android/libportable/common/include/stat_portable.h
index f42f57c..a2f3be7 100644
--- a/ndk/sources/android/libportable/common/include/stat_portable.h
+++ b/ndk/sources/android/libportable/common/include/stat_portable.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef _STAT_PORTABLE_H_
-#define _STAT_PORTABLE_H_
+#ifndef _StatPortable_H_
+#define _StatPortable_H_
#include <portability.h>
#include <stdint.h>
@@ -43,12 +43,12 @@
unsigned long st_ctime_nsec; \
unsigned char padding3[8];
-struct stat_portable { __STAT64_BODY_PORTABLE };
-#define stat64_portable stat_portable
+struct StatPortable { __STAT64_BODY_PORTABLE };
+typedef struct StatPortable Stat64Portable;
-static inline void stat_n2p(struct stat* pn, struct stat_portable* pp)
+static inline void stat_n2p(struct stat* pn, struct StatPortable* pp)
{
- memset(pp, '\0', sizeof(struct stat_portable));
+ memset(pp, '\0', sizeof(struct StatPortable));
pp->st_dev = pn->st_dev;
pp->st_ino = pn->st_ino;
pp->st_mode = pn->st_mode;
@@ -67,7 +67,7 @@
pp->st_ctime_nsec = pn->st_ctime_nsec;
}
-int WRAP(fstat)(int a, struct stat_portable* p)
+int WRAP(fstat)(int a, struct StatPortable* p)
{
struct stat target_stat_obj;
int ret = REAL(fstat)(a, &target_stat_obj);
@@ -75,12 +75,12 @@
return ret;
}
-int WRAP(fstat64)(int a, struct stat64_portable* p)
+int WRAP(fstat64)(int a, Stat64Portable* p)
{
return WRAP(fstat)(a, p);
}
-int WRAP(fstatat)(int a, const char* p1, struct stat_portable* p2, int b)
+int WRAP(fstatat)(int a, const char* p1, struct StatPortable* p2, int b)
{
struct stat target_stat_obj;
int ret = REAL(fstatat)(a, p1, &target_stat_obj, b);
@@ -88,12 +88,12 @@
return ret;
}
-int WRAP(fstatat64)(int a, const char* b, struct stat64_portable* c, int d)
+int WRAP(fstatat64)(int a, const char* b, Stat64Portable* c, int d)
{
return WRAP(fstatat)(a, b, c, d);
}
-int WRAP(lstat)(const char* a, struct stat_portable* p)
+int WRAP(lstat)(const char* a, struct StatPortable* p)
{
struct stat target_stat_obj;
int ret = REAL(lstat)(a, &target_stat_obj);
@@ -101,12 +101,12 @@
return ret;
}
-int WRAP(lstat64)(const char* a, struct stat64_portable* p)
+int WRAP(lstat64)(const char* a, Stat64Portable* p)
{
return WRAP(lstat)(a, p);
}
-int WRAP(stat)(const char* a, struct stat_portable* p)
+int WRAP(stat)(const char* a, struct StatPortable* p)
{
struct stat target_stat_obj;
int ret = REAL(stat)(a, &target_stat_obj);
@@ -114,9 +114,9 @@
return ret;
}
-int WRAP(stat64)(const char* a, struct stat64_portable* p)
+int WRAP(stat64)(const char* a, Stat64Portable* p)
{
return WRAP(stat)(a, p);
}
-#endif /* _STAT_PORTABLE_H */
+#endif /* _StatPortable_H */
diff --git a/ndk/sources/android/libportable/common/include/vfs_portable.h b/ndk/sources/android/libportable/common/include/vfs_portable.h
index 37bf101..ac57ded 100644
--- a/ndk/sources/android/libportable/common/include/vfs_portable.h
+++ b/ndk/sources/android/libportable/common/include/vfs_portable.h
@@ -39,14 +39,14 @@
uint64_t f_spare[5];
-struct statfs_portable { __STATFS64_BODY_PORTABLE };
-#define statfs64_portable statfs_portable
+struct StatfsPortable { __STATFS64_BODY_PORTABLE };
+typedef struct StatfsPortable Statfs64Portable;
#undef __STATFS64_BODY_PORTABLE
-static void statfs_n2p(const struct statfs* pn, struct statfs_portable* pp)
+static void statfs_n2p(const struct statfs* pn, struct StatfsPortable* pp)
{
- memset(pp, '\0', sizeof(struct statfs_portable));
+ memset(pp, '\0', sizeof(struct StatfsPortable));
pp->f_type = pn->f_type;
pp->f_bsize = pn->f_bsize;
pp->f_blocks = pn->f_blocks;
@@ -65,7 +65,7 @@
#endif
}
-int WRAP(statfs)(const char* path, struct statfs_portable* stat)
+int WRAP(statfs)(const char* path, struct StatfsPortable* stat)
{
struct statfs target_stat;
int ret = REAL(statfs)(path, &target_stat);
@@ -73,12 +73,12 @@
return ret;
}
-int WRAP(statfs64)(const char* path, struct statfs64_portable* stat)
+int WRAP(statfs64)(const char* path, Statfs64Portable* stat)
{
return WRAP(statfs)(path, stat);
}
-int WRAP(fstatfs)(int fd, struct statfs_portable* stat)
+int WRAP(fstatfs)(int fd, struct StatfsPortable* stat)
{
struct statfs target_stat;
int ret = REAL(fstatfs)(fd, &target_stat);
@@ -86,7 +86,7 @@
return ret;
}
-int WRAP(fstatfs64)(int fd, struct statfs64_portable* stat)
+int WRAP(fstatfs64)(int fd, Statfs64Portable* stat)
{
return WRAP(fstatfs)(fd, stat);
}