From 465c3bc97a2db530368635a20de9d780c7a0d180 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 21 Mar 2012 13:22:32 +0000 Subject: [PATCH] fixed compilation on MSVS2008 - do not use stdint.h git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11769 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_video_libavw.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/cl_video_libavw.c b/cl_video_libavw.c index 54238973..cf7f9550 100644 --- a/cl_video_libavw.c +++ b/cl_video_libavw.c @@ -21,12 +21,8 @@ */ -#include "common.h" -#ifdef _MSC_VERSION -#include "stdint.h" -#else -#include -#endif +// LordHavoc: for some reason this is being #include'd rather than treated as its own file... +// LordHavoc: adapted to not require stdint.h as this is not available on MSVC++, using unsigned char instead of uint8_t and fs_offset_t instead of int64_t. // scaler type #define LIBAVW_SCALER_BILINEAR 0 @@ -49,9 +45,9 @@ #define LIBAVW_PRINT_PANIC 4 // exported callback functions: typedef void avwCallbackPrint(int, const char *); -typedef int avwCallbackIoRead(void *, uint8_t *, int); -typedef int64_t avwCallbackIoSeek(void *, int64_t, int); -typedef int64_t avwCallbackIoSeekSize(void *); +typedef int avwCallbackIoRead(void *, unsigned char *, int); +typedef fs_offset_t avwCallbackIoSeek(void *, fs_offset_t, int); +typedef fs_offset_t avwCallbackIoSeekSize(void *); // exported functions: int (*qLibAvW_Init)(avwCallbackPrint *printfunction); // init library, returns error code const char *(*qLibAvW_ErrorString)(int errorcode); // get string for error code @@ -236,17 +232,17 @@ void libavw_close(void *stream) } // IO wrapper -int LibAvW_FS_Read(void *opaque, uint8_t *buf, int buf_size) +int LibAvW_FS_Read(void *opaque, unsigned char *buf, int buf_size) { return FS_Read((qfile_t *)opaque, buf, buf_size); } -int64_t LibAvW_FS_Seek(void *opaque, int64_t pos, int whence) +fs_offset_t LibAvW_FS_Seek(void *opaque, fs_offset_t pos, int whence) { - return (int64_t)FS_Seek((qfile_t *)opaque, pos, whence); + return (fs_offset_t)FS_Seek((qfile_t *)opaque, pos, whence); } -int64_t LibAvW_FS_SeekSize(void *opaque) +fs_offset_t LibAvW_FS_SeekSize(void *opaque) { - return (int64_t)FS_FileSize((qfile_t *)opaque); + return (fs_offset_t)FS_FileSize((qfile_t *)opaque); } // open as DP video stream -- 2.39.2