@@ -111,7 +111,9 @@ const void *__PHYSFS_winrtCalcPrefDir(void);
111111
112112/* atomic operations. */
113113/* increment/decrement operations return the final incremented/decremented value. */
114- #if defined(_MSC_VER ) && (_MSC_VER >= 1500 )
114+ #ifdef PHYSFS_PLATFORM_PLAYDATE
115+ #define PHYSFS_NEED_ATOMIC_OP_FALLBACK 1
116+ #elif defined(_MSC_VER ) && (_MSC_VER >= 1500 )
115117#include <intrin.h>
116118__PHYSFS_COMPILE_TIME_ASSERT (LongEqualsInt , sizeof (int ) == sizeof (long ));
117119#define __PHYSFS_ATOMIC_INCR (ptrval ) _InterlockedIncrement((long*)(ptrval))
@@ -130,6 +132,9 @@ extern __inline int _xadd_watcom(volatile int *a, int v);
130132#define __PHYSFS_ATOMIC_DECR (ptrval ) (_xadd_watcom(ptrval, -1)-1)
131133#else
132134#define PHYSFS_NEED_ATOMIC_OP_FALLBACK 1
135+ #endif
136+
137+ #ifdef PHYSFS_NEED_ATOMIC_OP_FALLBACK
133138int __PHYSFS_ATOMIC_INCR (int * ptrval );
134139int __PHYSFS_ATOMIC_DECR (int * ptrval );
135140#endif
@@ -466,12 +471,14 @@ void __PHYSFS_DirTreeDeinit(__PHYSFS_DirTree *dt);
466471
467472/*
468473 * Initialize the platform. This is called when PHYSFS_init() is called from
469- * the application.
474+ * the application. argv[0] (or whatever the app is passing) is
475+ * supplied here, since some platforms need it immediately, but this same
476+ * pointer is also passed to __PHYSFS_platformCalcBaseDir a little later.
470477 *
471478 * Return zero if there was a catastrophic failure (which prevents you from
472479 * functioning at all), and non-zero otherwise.
473480 */
474- int __PHYSFS_platformInit (void );
481+ int __PHYSFS_platformInit (const char * argv0 );
475482
476483
477484/*
0 commit comments