ソースを参照

-Made type cast changes that Ryan needs to approve.
-MSVC complained about 64-bit to 32-bit implicit conversions.
-Added Win32 specific #defines for 64-bit datatypes.

Gregory S. Read 24 年 前
コミット
5d5f15ca9a
2 ファイル変更12 行追加2 行削除
  1. 4 2
      physfs.c
  2. 8 0
      physfs.h

+ 4 - 2
physfs.c

@@ -110,7 +110,8 @@ static ErrMsg *findErrorForCurrentThread(void)
     __PHYSFS_platformGrabMutex(errorLock);
     __PHYSFS_platformGrabMutex(errorLock);
     if (errorMessages != NULL)
     if (errorMessages != NULL)
     {
     {
-        tid = __PHYSFS_platformGetThreadID();
+        /*!!! I think tid needs to be a 64-bit value??? */
+        tid = (int)__PHYSFS_platformGetThreadID();
 
 
         for (i = errorMessages; i != NULL; i = i->next)
         for (i = errorMessages; i != NULL; i = i->next)
         {
         {
@@ -143,7 +144,8 @@ void __PHYSFS_setError(const char *str)
             return;   /* uhh...? */
             return;   /* uhh...? */
 
 
         memset((void *) err, '\0', sizeof (ErrMsg));
         memset((void *) err, '\0', sizeof (ErrMsg));
-        err->tid = __PHYSFS_platformGetThreadID();
+        /*!!! I think tid needs to be a 64-bit value??? */
+        err->tid = (int)__PHYSFS_platformGetThreadID();
 
 
         __PHYSFS_platformGrabMutex(errorLock);
         __PHYSFS_platformGrabMutex(errorLock);
         err->next = errorMessages;
         err->next = errorMessages;

+ 8 - 0
physfs.h

@@ -129,6 +129,10 @@
 #ifndef _INCLUDE_PHYSFS_H_
 #ifndef _INCLUDE_PHYSFS_H_
 #define _INCLUDE_PHYSFS_H_
 #define _INCLUDE_PHYSFS_H_
 
 
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif
@@ -151,6 +155,10 @@ typedef signed int            PHYSFS_sint32;
 #ifdef PHYSFS_NO_64BIT_SUPPORT  /* oh well. */
 #ifdef PHYSFS_NO_64BIT_SUPPORT  /* oh well. */
 typedef PHYSFS_uint32         PHYSFS_uint64;
 typedef PHYSFS_uint32         PHYSFS_uint64;
 typedef PHYSFS_sint32         PHYSFS_sint64;
 typedef PHYSFS_sint32         PHYSFS_sint64;
+#elif _WIN32
+/*!!! No 64-bit unsigned in Win32???? */
+typedef LONGLONG              PHYSFS_sint64;
+typedef LONGLONG              PHYSFS_uint64;
 #else
 #else
 typedef unsigned long long    PHYSFS_uint64;
 typedef unsigned long long    PHYSFS_uint64;
 typedef signed long long      PHYSFS_sint64;
 typedef signed long long      PHYSFS_sint64;