Skip to content

Commit

Permalink
qemu-common.h: Move Win32 fixups into os-win32.h
Browse files Browse the repository at this point in the history
qemu-common.h includes some fixups for things the Win32
headers don't define or define weirdly. These really
belong in os-win32.h, so move them there.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
  • Loading branch information
pm215 committed Aug 19, 2015
1 parent 24134c4 commit 1aad810
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
17 changes: 0 additions & 17 deletions include/qemu-common.h
Expand Up @@ -86,23 +86,6 @@
# error Unknown pointer size
#endif

#ifdef _WIN32
#define fsync _commit
#if !defined(lseek)
# define lseek _lseeki64
#endif
int qemu_ftruncate64(int, int64_t);
#if !defined(ftruncate)
# define ftruncate qemu_ftruncate64
#endif

static inline char *realpath(const char *path, char *resolved_path)
{
_fullpath(resolved_path, path, _MAX_PATH);
return resolved_path;
}
#endif

void cpu_ticks_init(void);

/* icount */
Expand Down
18 changes: 18 additions & 0 deletions include/sysemu/os-win32.h
Expand Up @@ -109,4 +109,22 @@ static inline int os_mlock(void)
return -ENOSYS;
}

#define fsync _commit

#if !defined(lseek)
# define lseek _lseeki64
#endif

int qemu_ftruncate64(int, int64_t);

#if !defined(ftruncate)
# define ftruncate qemu_ftruncate64
#endif

static inline char *realpath(const char *path, char *resolved_path)
{
_fullpath(resolved_path, path, _MAX_PATH);
return resolved_path;
}

#endif

0 comments on commit 1aad810

Please sign in to comment.