[60806] trunk/dports/devel/physfs
jmr at macports.org
jmr at macports.org
Tue Nov 24 00:16:04 PST 2009
Revision: 60806
http://trac.macports.org/changeset/60806
Author: jmr at macports.org
Date: 2009-11-24 00:15:55 -0800 (Tue, 24 Nov 2009)
Log Message:
-----------
physfs: commit patch (#22665)
Added Paths:
-----------
trunk/dports/devel/physfs/files/
trunk/dports/devel/physfs/files/f254870dd7dd.diff
Added: trunk/dports/devel/physfs/files/f254870dd7dd.diff
===================================================================
--- trunk/dports/devel/physfs/files/f254870dd7dd.diff (rev 0)
+++ trunk/dports/devel/physfs/files/f254870dd7dd.diff 2009-11-24 08:15:55 UTC (rev 60806)
@@ -0,0 +1,162 @@
+
+# HG changeset patch
+# User Ryan C. Gordon <icculus at icculus.org>
+# Date 1252213527 14400
+# Node ID f254870dd7dd252f272dda49b3c545d3326cab79
+# Parent 6bc1363ad17d8d2a164c2d2b7204ef1c9a5fca13
+Attempt to clean up the thread ID mess in platform_unix ...
+
+--- a/src/physfs.c Sun Sep 06 01:04:17 2009 -0400
++++ b/src/physfs.c Sun Sep 06 01:05:27 2009 -0400
+@@ -43,7 +43,7 @@
+
+ typedef struct __PHYSFS_ERRMSGTYPE__
+ {
+- PHYSFS_uint64 tid;
++ void *tid;
+ int errorAvailable;
+ char errorString[80];
+ struct __PHYSFS_ERRMSGTYPE__ *next;
+@@ -268,7 +268,7 @@
+ static ErrMsg *findErrorForCurrentThread(void)
+ {
+ ErrMsg *i;
+- PHYSFS_uint64 tid;
++ void *tid;
+
+ if (errorLock != NULL)
+ __PHYSFS_platformGrabMutex(errorLock);
+--- a/src/physfs_internal.h Sun Sep 06 01:04:17 2009 -0400
++++ b/src/physfs_internal.h Sun Sep 06 01:05:27 2009 -0400
+@@ -1307,12 +1307,12 @@
+ char *__PHYSFS_platformGetUserDir(void);
+
+ /*
+- * Return a number that uniquely identifies the current thread.
+- * On a platform without threading, (1) will suffice. These numbers are
++ * Return a pointer that uniquely identifies the current thread.
++ * On a platform without threading, (0x1) will suffice. These numbers are
+ * arbitrary; the only requirement is that no two threads have the same
+- * number.
++ * pointer.
+ */
+-PHYSFS_uint64 __PHYSFS_platformGetThreadID(void);
++void *__PHYSFS_platformGetThreadID(void);
+
+ /*
+ * Return non-zero if filename (in platform-dependent notation) exists.
+--- a/src/platform/beos.cpp Sun Sep 06 01:04:17 2009 -0400
++++ b/src/platform/beos.cpp Sun Sep 06 01:05:27 2009 -0400
+@@ -194,9 +194,9 @@
+ } /* __PHYSFS_platformCalcBaseDir */
+
+
+-PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
++void *__PHYSFS_platformGetThreadID(void)
+ {
+- return((PHYSFS_uint64) find_thread(NULL));
++ return((void *) find_thread(NULL));
+ } /* __PHYSFS_platformGetThreadID */
+
+
+--- a/src/platform/macosx.c Sun Sep 06 01:04:17 2009 -0400
++++ b/src/platform/macosx.c Sun Sep 06 01:05:27 2009 -0400
+@@ -353,9 +353,9 @@
+ } /* __PHYSFS_platformSetDefaultAllocator */
+
+
+-PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
++void *__PHYSFS_platformGetThreadID(void)
+ {
+- return( (PHYSFS_uint64) ((size_t) MPCurrentTaskID()) );
++ return( (void *) ((size_t) MPCurrentTaskID()) );
+ } /* __PHYSFS_platformGetThreadID */
+
+
+--- a/src/platform/os2.c Sun Sep 06 01:04:17 2009 -0400
++++ b/src/platform/os2.c Sun Sep 06 01:05:27 2009 -0400
+@@ -658,7 +658,7 @@
+ } /* __PHYSFS_platformGetLastModTime */
+
+
+-PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
++void *__PHYSFS_platformGetThreadID(void)
+ {
+ PTIB ptib;
+ PPIB ppib;
+@@ -668,7 +668,7 @@
+ * default value (zero might as well do) if it does.
+ */
+ BAIL_IF_MACRO(os2err(DosGetInfoBlocks(&ptib, &ppib)) != NO_ERROR, 0, 0);
+- return((PHYSFS_uint64) ptib->tib_ordinal);
++ return((void *) ptib->tib_ordinal);
+ } /* __PHYSFS_platformGetThreadID */
+
+
+--- a/src/platform/pocketpc.c Sun Sep 06 01:04:17 2009 -0400
++++ b/src/platform/pocketpc.c Sun Sep 06 01:05:27 2009 -0400
+@@ -161,9 +161,9 @@
+ } /* __PHYSFS_platformGetUserDir */
+
+
+-PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
++void *__PHYSFS_platformGetThreadID(void)
+ {
+- return(1); /* single threaded. */
++ return((void *)1); /* single threaded. */ /* !!! FIXME: is this true? */
+ } /* __PHYSFS_platformGetThreadID */
+
+
+--- a/src/platform/unix.c Sun Sep 06 01:04:17 2009 -0400
++++ b/src/platform/unix.c Sun Sep 06 01:05:27 2009 -0400
+@@ -347,7 +347,7 @@
+
+ #if (defined PHYSFS_NO_PTHREADS_SUPPORT)
+
+-PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) { return(0x0001); }
++void *__PHYSFS_platformGetThreadID(void) { return((void *) 0x0001); }
+ void *__PHYSFS_platformCreateMutex(void) { return((void *) 0x0001); }
+ void __PHYSFS_platformDestroyMutex(void *mutex) {}
+ int __PHYSFS_platformGrabMutex(void *mutex) { return(1); }
+@@ -362,24 +362,10 @@
+ PHYSFS_uint32 count;
+ } PthreadMutex;
+
+-/* Just in case; this is a panic value. */
+-#if ((!defined SIZEOF_INT) || (SIZEOF_INT <= 0))
+-# define SIZEOF_INT 4
+-#endif
+
+-#if (SIZEOF_INT == 4)
+-# define PHTREAD_TO_UI64(thr) ( (PHYSFS_uint64) ((PHYSFS_uint32) (thr)) )
+-#elif (SIZEOF_INT == 2)
+-# define PHTREAD_TO_UI64(thr) ( (PHYSFS_uint64) ((PHYSFS_uint16) (thr)) )
+-#elif (SIZEOF_INT == 1)
+-# define PHTREAD_TO_UI64(thr) ( (PHYSFS_uint64) ((PHYSFS_uint8) (thr)) )
+-#else
+-# define PHTREAD_TO_UI64(thr) ((PHYSFS_uint64) (thr))
+-#endif
+-
+-PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
++void *__PHYSFS_platformGetThreadID(void)
+ {
+- return(PHTREAD_TO_UI64(pthread_self()));
++ return( (void *) ((size_t) pthread_self()) );
+ } /* __PHYSFS_platformGetThreadID */
+
+
+--- a/src/platform/windows.c Sun Sep 06 01:04:17 2009 -0400
++++ b/src/platform/windows.c Sun Sep 06 01:05:27 2009 -0400
+@@ -559,9 +559,9 @@
+ } /* __PHYSFS_platformGetUserDir */
+
+
+-PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
++void *__PHYSFS_platformGetThreadID(void)
+ {
+- return((PHYSFS_uint64) GetCurrentThreadId());
++ return( (void *) ((size_t) GetCurrentThreadId()) );
+ } /* __PHYSFS_platformGetThreadID */
+
+
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091124/9358a7ab/attachment-0001.html>
More information about the macports-changes
mailing list