Work-around for an obscure gcc 2.95.3 bug: It complained about ambiguity

of fssh_stat struct and function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20932 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-04-30 17:09:47 +00:00
parent b245b1a838
commit 4b32170efd
+12 -11
View File
@@ -27,6 +27,7 @@
#include "fssh_unistd.h" #include "fssh_unistd.h"
#include "hash.h" #include "hash.h"
#include "KPath.h" #include "KPath.h"
#include "posix_compatibility.h"
#include "syscalls.h" #include "syscalls.h"
@@ -4964,17 +4965,17 @@ _kern_access(const char *path, int mode)
fssh_status_t fssh_status_t
_kern_read_stat(int fd, const char *path, bool traverseLeafLink, _kern_read_stat(int fd, const char *path, bool traverseLeafLink,
struct fssh_stat *stat, fssh_size_t statSize) struct ::fssh_stat *stat, fssh_size_t statSize)
{ {
struct fssh_stat completeStat; struct ::fssh_stat completeStat;
struct fssh_stat *originalStat = NULL; struct ::fssh_stat *originalStat = NULL;
fssh_status_t status; fssh_status_t status;
if (statSize > sizeof(struct fssh_stat)) if (statSize > sizeof(struct ::fssh_stat))
return FSSH_B_BAD_VALUE; return FSSH_B_BAD_VALUE;
// this supports different stat extensions // this supports different stat extensions
if (statSize < sizeof(struct fssh_stat)) { if (statSize < sizeof(struct ::fssh_stat)) {
originalStat = stat; originalStat = stat;
stat = &completeStat; stat = &completeStat;
} }
@@ -5033,16 +5034,16 @@ _kern_read_stat(int fd, const char *path, bool traverseLeafLink,
fssh_status_t fssh_status_t
_kern_write_stat(int fd, const char *path, bool traverseLeafLink, _kern_write_stat(int fd, const char *path, bool traverseLeafLink,
const struct fssh_stat *stat, fssh_size_t statSize, int statMask) const struct ::fssh_stat *stat, fssh_size_t statSize, int statMask)
{ {
struct fssh_stat completeStat; struct ::fssh_stat completeStat;
if (statSize > sizeof(struct fssh_stat)) if (statSize > sizeof(struct ::fssh_stat))
return FSSH_B_BAD_VALUE; return FSSH_B_BAD_VALUE;
// this supports different stat extensions // this supports different stat extensions
if (statSize < sizeof(struct fssh_stat)) { if (statSize < sizeof(struct ::fssh_stat)) {
fssh_memset((uint8_t *)&completeStat + statSize, 0, sizeof(struct fssh_stat) - statSize); fssh_memset((uint8_t *)&completeStat + statSize, 0, sizeof(struct ::fssh_stat) - statSize);
fssh_memcpy(&completeStat, stat, statSize); fssh_memcpy(&completeStat, stat, statSize);
stat = &completeStat; stat = &completeStat;
} }
@@ -5133,7 +5134,7 @@ _kern_create_index(fssh_dev_t device, const char *name, uint32_t type, uint32_t
fssh_status_t fssh_status_t
_kern_read_index_stat(fssh_dev_t device, const char *name, struct fssh_stat *stat) _kern_read_index_stat(fssh_dev_t device, const char *name, struct ::fssh_stat *stat)
{ {
return index_name_read_stat(device, name, stat, true); return index_name_read_stat(device, name, stat, true);
} }