Browse files

Merge pull request #1107 from davilla/off_t-cleanup

cleanup, sort out off_t, _off_t, __off_t, and friends and remove dead code
  • Loading branch information...
2 parents f70b7d7 + 4d17686 commit c0ff7314d3ff2d2c4427a0b3bf3136ed5e4748b7 @davilla davilla committed Jul 4, 2012
View
4 xbmc/Util.cpp
@@ -1105,7 +1105,7 @@ void CUtil::Stat64ToStat(struct stat *result, struct __stat64 *stat)
result->st_size = (_off_t)stat->st_size;
#else
if (sizeof(stat->st_size) <= sizeof(result->st_size) )
- result->st_size = (off_t)stat->st_size;
+ result->st_size = stat->st_size;
#endif
else
{
@@ -1132,7 +1132,7 @@ void CUtil::Stat64ToStat64i32(struct _stat64i32 *result, struct __stat64 *stat)
result->st_size = (_off_t)stat->st_size;
#else
if (sizeof(stat->st_size) <= sizeof(result->st_size) )
- result->st_size = (off_t)stat->st_size;
+ result->st_size = stat->st_size;
#endif
else
{
View
6 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
@@ -593,12 +593,6 @@ extern "C"
return -1;
}
- int dll_fstatvfs64(int fd, struct statvfs64 *buf)
- {
- not_implement("msvcrt.dll incomplete function fstatvfs64(...) called\n");
- return -1;
- }
-
int dll_close(int fd)
{
CFile* pFile = g_emuFileWrapper.GetFileXbmcByDescriptor(fd);
View
8 xbmc/cores/DllLoader/exports/emu_msvcrt.h
@@ -27,6 +27,13 @@
#define _onexit_t void*
#endif
+#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD)
+typedef off_t __off_t;
+typedef int64_t off64_t;
+typedef off64_t __off64_t;
+typedef fpos_t fpos64_t;
+#endif
+
#ifdef WIN32
#include "win32-dirent.h"
#else
@@ -167,7 +174,6 @@ extern "C"
int dll_fstat64i32(int fd, struct _stat64i32 *buffer);
int dll_open_osfhandle(intptr_t _OSFileHandle, int _Flags);
#endif
- int dll_fstatvfs64(int fd, struct statvfs64 *buf);
int dll_setvbuf(FILE *stream, char *buf, int type, size_t size);
int dll_filbuf(FILE *fp);
int dll_flsbuf(int data, FILE*fp);
View
11 xbmc/cores/DllLoader/exports/wrapper.c
@@ -37,13 +37,12 @@
#include <dirent.h>
#endif
-#if defined(TARGET_DARWIN) || defined(__FreeBSD__)
-typedef int64_t off64_t;
+#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD)
typedef off_t __off_t;
+typedef int64_t off64_t;
typedef off64_t __off64_t;
typedef fpos_t fpos64_t;
#define stat64 stat
-#define statvfs64 statvfs
#if defined(TARGET_DARWIN)
#define _G_va_list va_list
#endif
@@ -109,7 +108,6 @@ int dll_ftrylockfile(FILE *file);
void dll_funlockfile(FILE *file);
int dll_fstat64(int fd, struct stat64 *buf);
int dll_fstat(int fd, struct _stat *buf);
-int dll_fstatvfs64(int fd, struct statvfs64 *buf);
FILE* dll_popen(const char *command, const char *mode);
int dll_setvbuf(FILE *stream, char *buf, int type, size_t size);
struct mntent *dll_getmntent(FILE *fp);
@@ -425,11 +423,6 @@ int __wrap___fxstat64(int ver, int fd, struct stat64 *buf)
return dll_fstat64(fd, buf);
}
-int __wrap_fstatvfs64(int fd, struct statvfs64 *buf)
-{
- return dll_fstatvfs64(fd, buf);
-}
-
int __wrap_fstat(int fd, struct _stat *buf)
{
return dll_fstat(fd, buf);
View
27 xbmc/linux/PlatformDefs.h
@@ -41,6 +41,8 @@
#include <string.h>
#if defined(TARGET_DARWIN)
#include <stdio.h>
+#include <sched.h>
+#include <AvailabilityMacros.h>
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
@@ -354,30 +356,15 @@ typedef int (*LPTHREAD_START_ROUTINE)(void *);
#define _O_TRUNC O_TRUNC
#define _O_RDONLY O_RDONLY
#define _O_WRONLY O_WRONLY
-#define _off_t off_t
-#if defined(TARGET_DARWIN)
- #include <sched.h>
- #include <AvailabilityMacros.h>
- typedef int64_t off64_t;
- typedef off_t __off_t;
- typedef off64_t __off64_t;
- typedef fpos_t fpos64_t;
- #define __stat64 stat
+#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD)
#define stat64 stat
- #if defined(TARGET_DARWIN_IOS)
- #define statfs64 statfs
- #endif
- #define fstat64 fstat
-#elif defined(__FreeBSD__)
- typedef int64_t off64_t;
- typedef off_t __off_t;
- typedef off64_t __off64_t;
- typedef fpos_t fpos64_t;
#define __stat64 stat
- #define stat64 stat
- #define statfs64 statfs
#define fstat64 fstat
+ typedef int64_t off64_t;
+ #if defined(TARGET_DARWIN_IOS) || defined(TARGET_FREEBSD)
+ #define statfs64 statfs
+ #endif
#else
#define __stat64 stat64
#endif

0 comments on commit c0ff731

Please sign in to comment.