]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed compilation on MSVS2008 - do not use stdint.h
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 21 Mar 2012 13:22:32 +0000 (13:22 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 21 Mar 2012 13:22:32 +0000 (13:22 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11769 d7cf8633-e32d-0410-b094-e92efae38249

cl_video_libavw.c

index 54238973258e9c4de28a1a6c00d2be4afb1d0075..cf7f955067e4b0d4c2c88047a276ad73247e63b1 100644 (file)
 \r
 */\r
 \r
-#include "common.h"\r
-#ifdef _MSC_VERSION\r
-#include "stdint.h"\r
-#else\r
-#include <stdint.h>\r
-#endif\r
+// LordHavoc: for some reason this is being #include'd rather than treated as its own file...\r
+// 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.\r
 \r
 // scaler type\r
 #define LIBAVW_SCALER_BILINEAR  0\r
@@ -49,9 +45,9 @@
 #define LIBAVW_PRINT_PANIC   4\r
 // exported callback functions:\r
 typedef void    avwCallbackPrint(int, const char *);\r
-typedef int     avwCallbackIoRead(void *, uint8_t *, int);\r
-typedef int64_t avwCallbackIoSeek(void *, int64_t, int);\r
-typedef int64_t avwCallbackIoSeekSize(void *);\r
+typedef int     avwCallbackIoRead(void *, unsigned char *, int);\r
+typedef fs_offset_t avwCallbackIoSeek(void *, fs_offset_t, int);\r
+typedef fs_offset_t avwCallbackIoSeekSize(void *);\r
 // exported functions:\r
 int         (*qLibAvW_Init)(avwCallbackPrint *printfunction); // init library, returns error code\r
 const char *(*qLibAvW_ErrorString)(int errorcode); // get string for error code\r
@@ -236,17 +232,17 @@ void libavw_close(void *stream)
 }\r
 \r
 // IO wrapper\r
-int LibAvW_FS_Read(void *opaque, uint8_t *buf, int buf_size)\r
+int LibAvW_FS_Read(void *opaque, unsigned char *buf, int buf_size)\r
 {\r
        return FS_Read((qfile_t *)opaque, buf, buf_size);\r
 }\r
-int64_t LibAvW_FS_Seek(void *opaque, int64_t pos, int whence)\r
+fs_offset_t LibAvW_FS_Seek(void *opaque, fs_offset_t pos, int whence)\r
 {\r
-       return (int64_t)FS_Seek((qfile_t *)opaque, pos, whence);\r
+       return (fs_offset_t)FS_Seek((qfile_t *)opaque, pos, whence);\r
 }\r
-int64_t LibAvW_FS_SeekSize(void *opaque)\r
+fs_offset_t LibAvW_FS_SeekSize(void *opaque)\r
 {\r
-       return (int64_t)FS_FileSize((qfile_t *)opaque);\r
+       return (fs_offset_t)FS_FileSize((qfile_t *)opaque);\r
 }\r
 \r
 // open as DP video stream\r